Class: SimpleJSONAPIClient::Relationships::HasOneRelationship
- Inherits:
-
Relationship
- Object
- Relationship
- SimpleJSONAPIClient::Relationships::HasOneRelationship
- Defined in:
- lib/simple_jsonapi_client/relationships/has_one_relationship.rb
Instance Method Summary collapse
Methods inherited from Relationship
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_one_relationship.rb', line 7 def call(info, included, connection) if (record = info['data']) SingularDataRelationship.new(model_class, record, included, connection) elsif (link = link_from(info)) SingularLinkRelationship.new(model_class, connection, link) end end |