Class: Facwparser::Element::TableHeaders

Inherits:
ElementBase 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.



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

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

Instance Attribute Details

#elementsObject (readonly)

Returns the value of attribute elements.



126
127
128
# File 'lib/facwparser/element.rb', line 126

def elements
  @elements
end

Instance Method Details

#render_html(options) ⇒ Object



131
132
133
134
135
# File 'lib/facwparser/element.rb', line 131

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