class SimpleJSONAPIClient::Relationships::Relationship
Attributes
url_opts[R]
Public Class Methods
new(model_class, url_opts = {})
click to toggle source
# File lib/simple_jsonapi_client/relationships/relationship.rb, line 4 def initialize(model_class, url_opts = {}) @model_class = model_class @url_opts = url_opts end
Public Instance Methods
call(*args)
click to toggle source
# File lib/simple_jsonapi_client/relationships/relationship.rb, line 9 def call(*args) raise NotImplementedError end
Private Instance Methods
link_from(info)
click to toggle source
# File lib/simple_jsonapi_client/relationships/relationship.rb, line 26 def link_from(info) info['links'].to_h.values_at('related', 'self').compact.first end
model_class()
click to toggle source
# File lib/simple_jsonapi_client/relationships/relationship.rb, line 16 def model_class @evaluated_model_class ||= case @model_class when String Kernel::const_get(@model_class) else @model_class end end