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.
28 29 30 31 |
# File 'lib/datatables_rails.rb', line 28 def initialize(data) @struct = {} @struct["aaData"] = data.collect{|d| d.attributes } end |
Instance Attribute Details
#struct ⇒ Object
Returns the value of attribute struct.
27 28 29 |
# File 'lib/datatables_rails.rb', line 27 def struct @struct end |
Instance Method Details
#formatter(&block) ⇒ Object
33 34 35 36 37 |
# File 'lib/datatables_rails.rb', line 33 def formatter(&block) @struct["aaData"].each do |s| block.call(s) end end |