Class: HtmlTable::TableBuilder::ColumnFooters
- Inherits:
-
Object
- Object
- HtmlTable::TableBuilder::ColumnFooters
- Defined in:
- lib/html_table/table_builder/column_footers.rb
Instance Attribute Summary collapse
-
#footer ⇒ Object
readonly
Returns the value of attribute footer.
-
#row ⇒ Object
readonly
Returns the value of attribute row.
Instance Method Summary collapse
- #footer_or_empty(column) ⇒ Object
-
#initialize(row, footer) ⇒ ColumnFooters
constructor
A new instance of ColumnFooters.
- #to_s ⇒ Object
Constructor Details
#initialize(row, footer) ⇒ ColumnFooters
Returns a new instance of ColumnFooters.
4 5 6 7 8 |
# File 'lib/html_table/table_builder/column_footers.rb', line 4 def initialize(row, ) @columns = row.columns @row = row @footer = end |
Instance Attribute Details
#footer ⇒ Object (readonly)
Returns the value of attribute footer.
2 3 4 |
# File 'lib/html_table/table_builder/column_footers.rb', line 2 def @footer end |
#row ⇒ Object (readonly)
Returns the value of attribute row.
2 3 4 |
# File 'lib/html_table/table_builder/column_footers.rb', line 2 def row @row end |
Instance Method Details
#footer_or_empty(column) ⇒ Object
16 17 18 |
# File 'lib/html_table/table_builder/column_footers.rb', line 16 def column [column] || " " end |
#to_s ⇒ Object
10 11 12 13 14 |
# File 'lib/html_table/table_builder/column_footers.rb', line 10 def to_s @columns.map do |column| "<th>#{(column)}</th>" end end |