Class: DatatablesRails::Structify
- Inherits:
-
Object
- Object
- DatatablesRails::Structify
- Defined in:
- lib/datatables_rails.rb
Instance Attribute Summary collapse
-
#struct ⇒ Object
Returns the value of attribute struct.
Instance Method Summary collapse
- #formatter(&block) ⇒ Object
-
#initialize(data) ⇒ Structify
constructor
A new instance of Structify.
Constructor Details
#initialize(data) ⇒ Structify
Returns a new instance of Structify.
38 39 40 41 |
# File 'lib/datatables_rails.rb', line 38 def initialize(data) @struct = {} @struct["aaData"] = data.collect{|d| d.attributes } end |
Instance Attribute Details
#struct ⇒ Object
Returns the value of attribute struct.
37 38 39 |
# File 'lib/datatables_rails.rb', line 37 def struct @struct end |
Instance Method Details
#formatter(&block) ⇒ Object
43 44 45 46 47 |
# File 'lib/datatables_rails.rb', line 43 def formatter(&block) @struct["aaData"].each do |s| block.call(s) end end |