Class: EasyDataTables::Column
- Inherits:
-
Object
- Object
- EasyDataTables::Column
- Defined in:
- app/models/easy_data_tables/column.rb
Overview
Column class, we can access the formated data and the data of a particular cell
Direct Known Subclasses
Instance Attribute Summary collapse
-
#label ⇒ Object
readonly
Returns the value of attribute label.
Instance Method Summary collapse
- #data_at(row) ⇒ Object
- #formated_data_at(row) ⇒ Object
-
#initialize(args = {}) ⇒ Column
constructor
values = {}, label = ”, type = ‘Integer’).
Constructor Details
#initialize(args = {}) ⇒ Column
values = {}, label = ”, type = ‘Integer’)
9 10 11 12 13 14 15 16 17 18 |
# File 'app/models/easy_data_tables/column.rb', line 9 def initialize(args = {}) @label = args[:label] || '' @type = args[:type] || 'Integer' @default = args[:default] || 0 @collection = args[:collection] @grouping = args[:grouping] @agregate_function = args[:agregate_function] @date_format = args[:date_format] || :default @values = construct_values end |
Instance Attribute Details
#label ⇒ Object (readonly)
Returns the value of attribute label.
6 7 8 |
# File 'app/models/easy_data_tables/column.rb', line 6 def label @label end |
Instance Method Details
#data_at(row) ⇒ Object
24 25 26 |
# File 'app/models/easy_data_tables/column.rb', line 24 def data_at(row) @values[row] end |
#formated_data_at(row) ⇒ Object
20 21 22 |
# File 'app/models/easy_data_tables/column.rb', line 20 def formated_data_at(row) send(@type.downcase, row) end |