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

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

Direct Known Subclasses

DeletedText

Constant Summary

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, #tag, tag

Methods included from AttributeBuilder

#attributes, included, #render?

Constructor Details

#initialize(text = nil) ⇒ Text


11
12
13
# File 'lib/openxml/docx/elements/text.rb', line 11

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


15
16
17
# File 'lib/openxml/docx/elements/text.rb', line 15

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