Class: TableGo::Column
- Inherits:
-
Object
- Object
- TableGo::Column
- Defined in:
- lib/table_go/column.rb
Instance Attribute Summary collapse
-
#block ⇒ Object
Returns the value of attribute block.
-
#name ⇒ Object
Returns the value of attribute name.
-
#options ⇒ Object
Returns the value of attribute options.
-
#table ⇒ Object
Returns the value of attribute table.
Instance Method Summary collapse
- #as ⇒ Object
- #as_options ⇒ Object
- #column_html ⇒ Object
- #header_html ⇒ Object
- #human_attribute_name ⇒ Object
-
#initialize(table, name, options = {}, &block) ⇒ Column
constructor
A new instance of Column.
- #label ⇒ Object
- #method ⇒ Object
- #send ⇒ Object
Constructor Details
#initialize(table, name, options = {}, &block) ⇒ Column
Returns a new instance of Column.
5 6 7 |
# File 'lib/table_go/column.rb', line 5 def initialize(table, name, = {}, &block) @table, @name, @options, @block = table, name, , block end |
Instance Attribute Details
#block ⇒ Object
Returns the value of attribute block.
3 4 5 |
# File 'lib/table_go/column.rb', line 3 def block @block end |
#name ⇒ Object
Returns the value of attribute name.
3 4 5 |
# File 'lib/table_go/column.rb', line 3 def name @name end |
#options ⇒ Object
Returns the value of attribute options.
3 4 5 |
# File 'lib/table_go/column.rb', line 3 def @options end |
#table ⇒ Object
Returns the value of attribute table.
3 4 5 |
# File 'lib/table_go/column.rb', line 3 def table @table end |
Instance Method Details
#as ⇒ Object
13 14 15 |
# File 'lib/table_go/column.rb', line 13 def as [:as] end |
#as_options ⇒ Object
21 22 23 |
# File 'lib/table_go/column.rb', line 21 def [:as_options] || {} end |
#column_html ⇒ Object
29 30 31 |
# File 'lib/table_go/column.rb', line 29 def column_html [:column_html] end |
#header_html ⇒ Object
25 26 27 |
# File 'lib/table_go/column.rb', line 25 def header_html [:header_html] end |
#human_attribute_name ⇒ Object
37 38 39 40 41 42 43 |
# File 'lib/table_go/column.rb', line 37 def human_attribute_name if table.model_klass.respond_to?(:human_attribute_name) # using rails default I18n table.model_klass.human_attribute_name(name).html_safe else name.to_s.humanize end end |
#label ⇒ Object
9 10 11 |
# File 'lib/table_go/column.rb', line 9 def label [:label] end |
#method ⇒ Object
33 34 35 |
# File 'lib/table_go/column.rb', line 33 def method [:method] end |
#send ⇒ Object
17 18 19 |
# File 'lib/table_go/column.rb', line 17 def send [:send] end |