Class: Inthegra::VehiclesSerializer

Inherits:
BaseSerializer show all
Defined in:
lib/inthegra/serializer/vehicles.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
11
12
13
14
15
# File 'lib/inthegra/serializer/vehicles.rb', line 6

def parse
  collection = []
  input.each do |line|
    line['Linha']['Veiculos'].each do |vehicles|
      collection << vehicles
    end
  end

  CollectionSerializer.parse(collection, model)
end