Class: OpenXml::Docx::Elements::Text

Inherits:
Element
  • Object
show all
Defined in:
lib/openxml/docx/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.



13
14
15
# File 'lib/openxml/docx/elements/text.rb', line 13

def initialize(text=nil)
  @text = text
end

Instance Attribute Details

#textObject (readonly)

Returns the value of attribute text.



5
6
7
# File 'lib/openxml/docx/elements/text.rb', line 5

def text
  @text
end

Instance Method Details

#to_xml(xml) ⇒ Object



17
18
19
# File 'lib/openxml/docx/elements/text.rb', line 17

def to_xml(xml)
  xml["w"].public_send(tag, text, xml_attributes)
end