Class: Rocx::Elements::Text

Inherits:
Element
  • Object
show all
Defined in:
lib/rocx/elements/text.rb

Direct Known Subclasses

DeletedText

Constant Summary collapse

VALID_SPACE_PRESERVES =
[:preserve, nil]

Constants included from AttributeBuilder

AttributeBuilder::VALID_THEME_COLORS, AttributeBuilder::VALID_TYPES

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#textObject (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