Class: HtmlTable::TableBuilder::ColumnHeaders

Inherits:
Object
  • Object
show all
Defined in:
lib/html_table/table_builder/column_headers.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(row) ⇒ ColumnHeaders

Returns a new instance of ColumnHeaders.



4
5
6
7
# File 'lib/html_table/table_builder/column_headers.rb', line 4

def initialize(row)
  @columns = row.columns
  @row = row
end

Instance Attribute Details

#rowObject (readonly)

Returns the value of attribute row.



2
3
4
# File 'lib/html_table/table_builder/column_headers.rb', line 2

def row
  @row
end

Instance Method Details

#column_translation(column) ⇒ Object



15
16
17
# File 'lib/html_table/table_builder/column_headers.rb', line 15

def column_translation column
  column
end

#to_sObject



9
10
11
12
13
# File 'lib/html_table/table_builder/column_headers.rb', line 9

def to_s
  @columns.map do |column|
    "<th>#{column_translation(column)}</th>"
  end
end