Class: JsonApiClient::Associations::BelongsTo::Association
Instance Attribute Summary
#attr_name, #klass, #options
Instance Method Summary
collapse
#association_class, #initialize
Instance Method Details
#param ⇒ Object
18
19
20
|
# File 'lib/json_api_client/associations/belongs_to.rb', line 18
def param
:"#{attr_name}_id"
end
|
#parse(params) ⇒ Object
14
15
16
|
# File 'lib/json_api_client/associations/belongs_to.rb', line 14
def parse(params)
params ? association_class.new(params) : nil
end
|
#to_prefix_path ⇒ Object
22
23
24
|
# File 'lib/json_api_client/associations/belongs_to.rb', line 22
def to_prefix_path
"#{attr_name.to_s.pluralize}/%{#{param}}"
end
|