<Toplevel Module>
TmStd
—
#8
DocBook
—
#10
Leaf
—
#12
Include
—
#14
Element
—
#16
inherits from |
| ||||||||||||||||
has properties |
|
Text
—
#38
Element
—
#40
inherits from |
| ||||||||||||
has properties |
|
RawText
—
#62
Title
—
#74
PubDate
—
#86
Primary
—
#98
Secondary
—
#110
Tertiary
—
#122
Literal
—
#134
Constant
—
#146
VarName
—
#158
ClassName
—
#170
Function
—
#182
FileName
—
#194
Index
—
#206
Element
—
#208
inherits from |
| ||||
has properties |
|
Anchor
—
#218
Element
—
#220
inherits from |
| ||||
has properties |
|
ColSpec
—
#230
Element
—
#232
inherits from |
| ||||||||
has properties |
|
Object
(
Builtin-Module
)
Abstract
(
TmStd::Lsm
)
Abstract
(
TmStd::Lsm::Product
)
Element
(
TmStd::DocBook::Abstraction
)
LeafElement
(
TmStd::DocBook::Abstraction
)
Name
(
TmStd::DocBook::Abstraction
)
Element
(
TmStd::DocBook::Leaf::Include
)
—
#16
Element
(
TmStd::DocBook::Leaf::Text
)
—
#40
Element
(
TmStd::DocBook::Leaf::Index
)
—
#208
Element
(
TmStd::DocBook::Leaf::Anchor
)
—
#220
Element
(
TmStd::DocBook::Leaf::ColSpec
)
—
#232
1 # $Id: leaf.rb,v 1.4 2012/01/20 18:11:33 machan Exp $ 2 3 require 'tmdoc/tmstd' 4 require 'tmdoc/tmstd/xml' 5 require 'tmdoc/tmstd/docbook/abstraction' 6 7 8 module TmStd 9 10 module DocBook 11 12 module Leaf 13 14 module Include 15 16 class Element < Abstraction::LeafElement 17 attr_reader :name, :suffix 18 19 20 def initialize(name, suffix) 21 Assertion.kind_of name, String 22 Assertion.kind_of suffix, String 23 24 @name = name 25 @suffix = suffix 26 end 27 28 29 def to_xml 30 Xml::Include.new(format("%s.%s", @name, @suffix)) 31 end 32 end 33 34 end 35 36 37 38 module Text 39 40 class Element < Abstraction::LeafElement 41 attr_reader :text 42 43 44 def initialize(text) 45 Assertion.kind_of text, String 46 47 super() 48 49 @text = text 50 end 51 52 53 def to_xml 54 Xml::Text.new @text 55 end 56 end 57 58 end 59 60 61 62 module RawText 63 64 class Element < Text::Element 65 def to_xml 66 Xml::RawText.new self.text 67 end 68 end 69 70 end 71 72 73 74 module Title 75 76 class Element < Abstraction::Name 77 def to_xml; 78 super :title 79 end 80 end 81 82 end 83 84 85 86 module PubDate 87 88 class Element < Abstraction::Name 89 def to_xml 90 super :pubdate 91 end 92 end 93 94 end 95 96 97 98 module Primary 99 100 class Element < Abstraction::Name 101 def to_xml 102 super :primary 103 end 104 end 105 106 end 107 108 109 110 module Secondary 111 112 class Element < Abstraction::Name 113 def to_xml 114 super :secondary 115 end 116 end 117 118 end 119 120 121 122 module Tertiary 123 124 class Element < Abstraction::Name 125 def to_xml 126 super :tertiary 127 end 128 end 129 130 end 131 132 133 134 module Literal 135 136 class Element < Abstraction::Name 137 def to_xml 138 super :literal 139 end 140 end 141 142 end 143 144 145 146 module Constant 147 148 class Element < Abstraction::Name 149 def to_xml 150 super :constant 151 end 152 end 153 154 end 155 156 157 158 module VarName 159 160 class Element < Abstraction::Name 161 def to_xml 162 super :varname 163 end 164 end 165 166 end 167 168 169 170 module ClassName 171 172 class Element < Abstraction::Name 173 def to_xml 174 super :classname 175 end 176 end 177 178 end 179 180 181 182 module Function 183 184 class Element < Abstraction::Name 185 def to_xml 186 super :function 187 end 188 end 189 190 end 191 192 193 194 module FileName 195 196 class Element < Abstraction::Name 197 def to_xml 198 super :filename 199 end 200 end 201 202 end 203 204 205 206 module Index 207 208 class Element < Abstraction::LeafElement 209 def to_xml 210 super :index 211 end 212 end 213 214 end 215 216 217 218 module Anchor 219 220 class Element < Abstraction::LeafElement 221 def to_xml 222 super :anchor 223 end 224 end 225 226 end 227 228 229 230 module ColSpec 231 232 class Element < Abstraction::LeafElement 233 def initialize(attrs = {}) 234 Assertion.kind_of attrs, Hash 235 236 @attr_align = nil 237 common_attrs = parse_attributes( 238 attrs, :align => [ String, lambda { |val| @attr_align = val } ] 239 ) 240 241 super common_attrs 242 end 243 244 245 def to_xml 246 attrs = attributes :align => @attr_align 247 248 super :colspec, attrs 249 end 250 end 251 252 end 253 254 end # TmStd::DocBook::Leaf 255 256 end # TmStd::DocBook 257 258 end # TmStd