Class: HtmlTable::TableBuilder
- Inherits:
-
Object
- Object
- HtmlTable::TableBuilder
- Defined in:
- lib/html_table/table_builder.rb
Defined Under Namespace
Classes: ColumnFooters, ColumnHeaders
Instance Attribute Summary collapse
-
#rows ⇒ Object
Returns the value of attribute rows.
Instance Method Summary collapse
-
#initialize(collection, options = {}, &block) ⇒ TableBuilder
constructor
A new instance of TableBuilder.
- #to_s ⇒ Object
Constructor Details
#initialize(collection, options = {}, &block) ⇒ TableBuilder
Returns a new instance of TableBuilder.
6 7 8 9 10 11 |
# File 'lib/html_table/table_builder.rb', line 6 def initialize(collection, ={}, &block) init_instance_vars() collection.each do |object| @rows << HtmlTable::TableRowBuilder.new(object, &block) end end |
Instance Attribute Details
#rows ⇒ Object
Returns the value of attribute rows.
4 5 6 |
# File 'lib/html_table/table_builder.rb', line 4 def rows @rows end |
Instance Method Details
#to_s ⇒ Object
13 14 15 16 17 18 19 |
# File 'lib/html_table/table_builder.rb', line 13 def to_s "<table#{attributes}> #{thead} #{tbody} #{tfoot} </table>" end |