Class: Facwparser::Element::Table
- Inherits:
-
ElementBase
- Object
- ElementBase
- Facwparser::Element::Table
- Defined in:
- lib/facwparser/element.rb
Instance Attribute Summary
Attributes inherited from ElementBase
Instance Method Summary collapse
-
#initialize ⇒ Table
constructor
A new instance of Table.
- #push(item) ⇒ Object
- #render_html(options) ⇒ Object
Methods inherited from ElementBase
Constructor Details
#initialize ⇒ Table
Returns a new instance of Table.
110 111 112 |
# File 'lib/facwparser/element.rb', line 110 def initialize() super('') end |
Instance Method Details
#push(item) ⇒ Object
113 114 115 116 117 |
# File 'lib/facwparser/element.rb', line 113 def push(item) @children ||= [] @children.push(item) self end |
#render_html(options) ⇒ Object
118 119 120 121 122 123 |
# File 'lib/facwparser/element.rb', line 118 def render_html() "<table>\n" + render_html_by_name_and_children('thead', @children.take(1), , "\n", "\n") + "\n" + render_html_by_name_and_children('tbody', @children.drop(1), , "\n", "\n") + "\n" + "</table>\n" end |