Class: MarkdownList
- Defined in:
- lib/almirah/doc_items/markdown_list.rb
Instance Attribute Summary collapse
-
#rows ⇒ Object
Returns the value of attribute rows.
Attributes inherited from DocItem
Instance Method Summary collapse
- #addRow(row) ⇒ Object
-
#initialize(first_row) ⇒ MarkdownList
constructor
A new instance of MarkdownList.
- #to_html ⇒ Object
Constructor Details
#initialize(first_row) ⇒ MarkdownList
Returns a new instance of MarkdownList.
7 8 9 10 |
# File 'lib/almirah/doc_items/markdown_list.rb', line 7 def initialize(first_row) @rows = Array.new @rows.append(first_row) end |
Instance Attribute Details
#rows ⇒ Object
Returns the value of attribute rows.
5 6 7 |
# File 'lib/almirah/doc_items/markdown_list.rb', line 5 def rows @rows end |
Instance Method Details
#addRow(row) ⇒ Object
12 13 14 |
# File 'lib/almirah/doc_items/markdown_list.rb', line 12 def addRow(row) @rows.append(row) end |
#to_html ⇒ Object
16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 |
# File 'lib/almirah/doc_items/markdown_list.rb', line 16 def to_html s = '' if @@htmlTableRenderInProgress s += "</table>\n" @@htmlTableRenderInProgress = false end s += "<ul>\n" @rows.each do |r| s += "\t<li>#{r}</li>\n" end s += "</ul>\n" return s end |