Class: ApiMapper::Serializer
- Inherits:
-
Object
- Object
- ApiMapper::Serializer
- Defined in:
- lib/api_mapper/client.rb
Instance Method Summary collapse
- #call ⇒ Object
-
#initialize(model) ⇒ Serializer
constructor
A new instance of Serializer.
Constructor Details
#initialize(model) ⇒ Serializer
Returns a new instance of Serializer.
59 60 61 |
# File 'lib/api_mapper/client.rb', line 59 def initialize(model) @model = model end |
Instance Method Details
#call ⇒ Object
63 64 65 66 67 |
# File 'lib/api_mapper/client.rb', line 63 def call attributes.inject({}) do |response, (key, value)| response.merge(key => value) end.to_json if @model end |