Class: TableMe::Column
- Inherits:
-
Object
- Object
- TableMe::Column
- Defined in:
- lib/table_me/column.rb
Overview
This class is the column object that gets created everytime a column is used in the table_for_presenter block It’s basically a value object which keeps track of the data for each individual column.
Instance Attribute Summary collapse
-
#content ⇒ Object
Returns the value of attribute content.
-
#name ⇒ Object
Returns the value of attribute name.
-
#sortable ⇒ Object
Returns the value of attribute sortable.
Instance Method Summary collapse
-
#initialize(column_name, args = {}, &block) ⇒ Column
constructor
A new instance of Column.
Constructor Details
#initialize(column_name, args = {}, &block) ⇒ Column
Returns a new instance of Column.
8 9 10 11 12 13 14 15 16 17 |
# File 'lib/table_me/column.rb', line 8 def initialize column_name, args = {}, &block self.name = column_name self.content = block if block self.sortable = args[:sort_on] else self.sortable = column_name end end |
Instance Attribute Details
#content ⇒ Object
Returns the value of attribute content.
7 8 9 |
# File 'lib/table_me/column.rb', line 7 def content @content end |
#name ⇒ Object
Returns the value of attribute name.
7 8 9 |
# File 'lib/table_me/column.rb', line 7 def name @name end |
#sortable ⇒ Object
Returns the value of attribute sortable.
7 8 9 |
# File 'lib/table_me/column.rb', line 7 def sortable @sortable end |