Class: RubyDocx::Elements::Paragraph
- Defined in:
- lib/ruby_docx/elements/paragraph.rb
Instance Attribute Summary
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 Method Details
#to_html ⇒ Object
8 9 10 11 12 13 14 15 |
# File 'lib/ruby_docx/elements/paragraph.rb', line 8 def to_html if self.elements.size <= 0 "<p> </p>" else "<p>#{self.elements.map(&:to_html).join}</p>" end end |
#to_s ⇒ Object
4 5 6 |
# File 'lib/ruby_docx/elements/paragraph.rb', line 4 def to_s "#{self.elements.map(&:to_s).join}" end |