Class: ObjectJSONMapper::Associations::HasMany

Inherits:
Association
  • Object
show all
Defined in:
lib/object_json_mapper/associations/has_many.rb

Instance Attribute Summary

Attributes inherited from Association

#name, #params

Instance Method Summary collapse

Methods inherited from Association

#endpoint, #initialize, #klass

Constructor Details

This class inherits a constructor from ObjectJSONMapper::Associations::Association

Instance Method Details

#call(object) ⇒ ObjectJSONMapper::Relation

Parameters:

Returns:



6
7
8
9
10
# File 'lib/object_json_mapper/associations/has_many.rb', line 6

def call(object)
  klass.where.tap do |relation|
    relation.path = object.client[endpoint].url
  end
end