Class: TableHelper::Table
- Inherits:
-
Object
- Object
- TableHelper::Table
- Defined in:
- lib/flexa_lib/table_for_boolean_column.rb
Overview
:nodoc:
Instance Method Summary collapse
Instance Method Details
#boolean_column(*args, &block) ⇒ Object
10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 |
# File 'lib/flexa_lib/table_for_boolean_column.rb', line 10 def boolean_column(*args, &block) = args. res = nil [:html] = { :th => { :width => "1%",:style=>"text-align: center;" }, :td => { :style=>"text-align: center;" }} attr = args.shift or nil if block_given? [:callback] = block @columns << (res = CallbackColumn.new(@template, @records, attr, )) elsif attr @columns << (res = BooleanColumn.new(@template, @records, attr, )) else raise ArgumentError, "Attribute name or block should be given" end res end |