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