Class: TableGo::Columns

Inherits:
Object
  • Object
show all
Includes:
Enumerable
Defined in:
lib/table_go/columns.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#tableObject

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, options = {}, &block)
  @columns << Column.new(table, name, options, &block)
end

#each(&block) ⇒ Object



14
15
16
# File 'lib/table_go/columns.rb', line 14

def each(&block)
  @columns.each(&block)
end