Class: Facwparser::Element::TableHeaders

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

Instance Attribute Summary collapse

Attributes inherited from ElementBase

#children, #source

Instance Method Summary collapse

Methods inherited from ElementBase

#==, #render_text

Constructor Details

#initialize(source, value) ⇒ TableHeaders

Returns a new instance of TableHeaders.



129
130
131
132
# File 'lib/facwparser/element.rb', line 129

def initialize(source, value)
  super(source)
  @elements = value[2..-3].split('||')
end

Instance Attribute Details

#elementsObject (readonly)

Returns the value of attribute elements.



128
129
130
# File 'lib/facwparser/element.rb', line 128

def elements
  @elements
end

Instance Method Details

#render_html(options) ⇒ Object



133
134
135
136
137
# File 'lib/facwparser/element.rb', line 133

def render_html(options)
  "<tr>" +
    @elements.map { |e| render_html_by_name_and_children('th', Parser.parse_value(e, options), options) }.join() +
    "</tr>"
end