Class: Paragraph
- Defined in:
- lib/almirah/doc_items/paragraph.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#text ⇒ Object
Returns the value of attribute text.
Attributes inherited from DocItem
Instance Method Summary collapse
- #getTextWithoutSpaces ⇒ Object
-
#initialize(text) ⇒ Paragraph
constructor
A new instance of Paragraph.
- #to_html ⇒ Object
Methods inherited from TextLine
add_lazy_doc_id, #bold, #bold_and_italic, #change_state, #format_string, #italic, #link
Constructor Details
#initialize(text) ⇒ Paragraph
Returns a new instance of Paragraph.
7 8 9 |
# File 'lib/almirah/doc_items/paragraph.rb', line 7 def initialize(text) @text = text end |
Instance Attribute Details
#text ⇒ Object
Returns the value of attribute text.
5 6 7 |
# File 'lib/almirah/doc_items/paragraph.rb', line 5 def text @text end |
Instance Method Details
#getTextWithoutSpaces ⇒ Object
11 12 13 |
# File 'lib/almirah/doc_items/paragraph.rb', line 11 def getTextWithoutSpaces return @text.split.join('-').downcase end |
#to_html ⇒ Object
15 16 17 18 19 20 21 22 23 24 |
# File 'lib/almirah/doc_items/paragraph.rb', line 15 def to_html s = '' if @@htmlTableRenderInProgress s += "</table>" @@htmlTableRenderInProgress = false end s += "<p>" + format_string(@text) return s end |