Class: Inthegra::CollectionSerializer

Inherits:
BaseSerializer show all
Defined in:
lib/inthegra/serializer/collection.rb

Instance Attribute Summary

Attributes inherited from BaseSerializer

#input, #model, #output

Instance Method Summary collapse

Methods inherited from BaseSerializer

#initialize, parse

Constructor Details

This class inherits a constructor from Inthegra::BaseSerializer

Instance Method Details

#parseArray

Parse a generic collection with your model type

Returns:

  • (Array)

    collection items



6
7
8
9
10
# File 'lib/inthegra/serializer/collection.rb', line 6

def parse
  input.map do |item|
    model.new(item)
  end
end