Class: DatatablesRecordsMapper::Mapper
- Inherits:
-
Object
- Object
- DatatablesRecordsMapper::Mapper
- Defined in:
- lib/datatables_records_mapper/mapper.rb
Instance Method Summary collapse
-
#initialize(model, params, mapper, options = {}) ⇒ Mapper
constructor
A new instance of Mapper.
- #mapped_records ⇒ Object
Constructor Details
#initialize(model, params, mapper, options = {}) ⇒ Mapper
Returns a new instance of Mapper.
3 4 5 6 7 8 |
# File 'lib/datatables_records_mapper/mapper.rb', line 3 def initialize(model, params, mapper, = {}) @model = model @params = params @mapper = mapper @options = end |
Instance Method Details
#mapped_records ⇒ Object
10 11 12 13 |
# File 'lib/datatables_records_mapper/mapper.rb', line 10 def mapped_records records['data'] = records['data'].map { |r| @mapper.map(r) } records end |