Class: Trestle::Table::Builder
- Defined in:
- lib/trestle/table/builder.rb
Instance Method Summary collapse
- #actions(&block) ⇒ Object
- #column(field, proc = nil, options = {}, &block) ⇒ Object
-
#initialize(options = {}) ⇒ Builder
constructor
A new instance of Builder.
- #row(options = {}, &block) ⇒ Object
- #selectable_column ⇒ Object
Methods inherited from Builder
Constructor Details
Instance Method Details
#actions(&block) ⇒ Object
27 28 29 |
# File 'lib/trestle/table/builder.rb', line 27 def actions(&block) table.columns << ActionsColumn.new(table, &block) end |
#column(field, proc = nil, options = {}, &block) ⇒ Object
18 19 20 21 22 23 24 25 |
# File 'lib/trestle/table/builder.rb', line 18 def column(field, proc=nil, ={}, &block) if proc.is_a?(Hash) = proc proc = nil end table.columns << Column.new(table, field, , &(proc || block)) end |
#row(options = {}, &block) ⇒ Object
10 11 12 |
# File 'lib/trestle/table/builder.rb', line 10 def row(={}, &block) table.row = Row.new(table, , &block) end |
#selectable_column ⇒ Object
14 15 16 |
# File 'lib/trestle/table/builder.rb', line 14 def selectable_column table.columns << SelectColumn.new(table) end |