Class: Facwparser::Element::Table

Inherits:
ElementBase show all
Defined in:
lib/facwparser/element.rb

Instance Attribute Summary

Attributes inherited from ElementBase

#children, #source

Instance Method Summary collapse

Methods inherited from ElementBase

#==, #render_text

Constructor Details

#initializeTable

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(options)
  "<table>\n" +
    render_html_by_name_and_children('thead', @children.take(1), options, "\n", "\n") + "\n" +
    render_html_by_name_and_children('tbody', @children.drop(1), options, "\n", "\n") + "\n" +
    "</table>\n"
end