Class: HTML::Tbody

Inherits:
Struct
  • Object
show all
Defined in:
lib/html/table.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#dataObject

Returns the value of attribute data

Returns:

  • (Object)

    the current value of data



22
23
24
# File 'lib/html/table.rb', line 22

def data
  @data
end

Instance Method Details

#to_htmlObject



23
24
25
26
27
28
# File 'lib/html/table.rb', line 23

def to_html
  return "" unless data && data.respond_to?(:rows)
  Builder.build(data.rows) do |rows|
    tag(:tbody, rows.map { |cols| tr(cols) })
  end
end