Class: RubyDocx::Elements::Text
- Defined in:
- lib/ruby_docx/elements/text.rb
Instance Attribute Summary collapse
-
#color ⇒ Object
readonly
Returns the value of attribute color.
-
#content ⇒ Object
Returns the value of attribute content.
-
#font_name ⇒ Object
readonly
Returns the value of attribute font_name.
-
#font_size ⇒ Object
readonly
Returns the value of attribute font_size.
Attributes inherited from Element
Instance Method Summary collapse
Methods inherited from Element
#elements, #initialize, #inspect, #to_xml
Constructor Details
This class inherits a constructor from RubyDocx::Elements::Element
Instance Attribute Details
#color ⇒ Object (readonly)
Returns the value of attribute color.
3 4 5 |
# File 'lib/ruby_docx/elements/text.rb', line 3 def color @color end |
#content ⇒ Object
Returns the value of attribute content.
4 5 6 |
# File 'lib/ruby_docx/elements/text.rb', line 4 def content @content end |
#font_name ⇒ Object (readonly)
Returns the value of attribute font_name.
3 4 5 |
# File 'lib/ruby_docx/elements/text.rb', line 3 def font_name @font_name end |
#font_size ⇒ Object (readonly)
Returns the value of attribute font_size.
3 4 5 |
# File 'lib/ruby_docx/elements/text.rb', line 3 def font_size @font_size end |
Instance Method Details
#element ⇒ Object
6 7 8 |
# File 'lib/ruby_docx/elements/text.rb', line 6 def element @element ||= @node.children.first end |
#to_html ⇒ Object
26 27 28 |
# File 'lib/ruby_docx/elements/text.rb', line 26 def to_html "#{self.content.gsub(/ /, " ")}" end |
#to_s ⇒ Object
22 23 24 |
# File 'lib/ruby_docx/elements/text.rb', line 22 def to_s self.content.to_s end |