Class: TableGo::Columns
- Inherits:
-
Object
- Object
- TableGo::Columns
- Includes:
- Enumerable
- Defined in:
- lib/table_go/columns.rb
Instance Attribute Summary collapse
-
#table ⇒ Object
Returns the value of attribute table.
Instance Method Summary collapse
- #column(name, options = {}, &block) ⇒ Object
- #each(&block) ⇒ Object
-
#initialize(table) ⇒ Columns
constructor
A new instance of Columns.
Constructor Details
#initialize(table) ⇒ Columns
Returns a new instance of Columns.
6 7 8 |
# File 'lib/table_go/columns.rb', line 6 def initialize(table) @table, @columns = table, [] end |
Instance Attribute Details
#table ⇒ Object
Returns the value of attribute table.
4 5 6 |
# File 'lib/table_go/columns.rb', line 4 def table @table end |
Instance Method Details
#column(name, options = {}, &block) ⇒ Object
10 11 12 |
# File 'lib/table_go/columns.rb', line 10 def column(name, = {}, &block) @columns << Column.new(table, name, , &block) end |
#each(&block) ⇒ Object
14 15 16 |
# File 'lib/table_go/columns.rb', line 14 def each(&block) @columns.each(&block) end |