Class: SimpleJSONAPIClient::Relationships::HasManyRelationship

Inherits:
Relationship
  • Object
show all
Defined in:
lib/simple_jsonapi_client/relationships/has_many_relationship.rb

Instance Method Summary collapse

Methods inherited from Relationship

#initialize

Constructor Details

This class inherits a constructor from SimpleJSONAPIClient::Relationships::Relationship

Instance Method Details

#call(info, included, connection) ⇒ Object



7
8
9
10
11
12
13
# File 'lib/simple_jsonapi_client/relationships/has_many_relationship.rb', line 7

def call(info, included, connection)
  if (records = info['data'])
    ArrayDataRelationship.new(model_class, records, included, connection)
  elsif (link = link_from(info))
    ArrayLinkRelationship.new(model_class, connection, link)
  end
end