Class: Rocx::Elements::Text
- Defined in:
- lib/rocx/elements/text.rb
Direct Known Subclasses
Constant Summary collapse
- VALID_SPACE_PRESERVES =
[:preserve, nil]
Constants included from AttributeBuilder
AttributeBuilder::VALID_THEME_COLORS, AttributeBuilder::VALID_TYPES
Instance Attribute Summary collapse
-
#text ⇒ Object
readonly
Returns the value of attribute text.
Instance Method Summary collapse
-
#initialize(text = nil) ⇒ Text
constructor
A new instance of Text.
- #to_xml(xml) ⇒ Object
Methods inherited from Element
#name, name, namespace, #namespace, #tag, tag
Methods included from AttributeBuilder
#attributes, included, #render?
Constructor Details
#initialize(text = nil) ⇒ Text
Returns a new instance of Text.
12 13 14 |
# File 'lib/rocx/elements/text.rb', line 12 def initialize(text=nil) @text = text end |
Instance Attribute Details
#text ⇒ Object (readonly)
Returns the value of attribute text.
4 5 6 |
# File 'lib/rocx/elements/text.rb', line 4 def text @text end |
Instance Method Details
#to_xml(xml) ⇒ Object
16 17 18 |
# File 'lib/rocx/elements/text.rb', line 16 def to_xml(xml) xml["w"].public_send(tag, text, xml_attributes) end |