Class: JsonApiClient::Associations::BelongsTo::Association
Instance Attribute Summary
#attr_name, #klass, #options
Instance Method Summary
collapse
#encode_part
#association_class, #data, #from_result_set, #initialize
Instance Method Details
#param ⇒ Object
15
16
17
|
# File 'lib/json_api_client/associations/belongs_to.rb', line 15
def param
:"#{attr_name}_id"
end
|
#set_prefix_path(attrs) ⇒ Object
23
24
25
26
|
# File 'lib/json_api_client/associations/belongs_to.rb', line 23
def set_prefix_path(attrs)
attrs[param] = encode_part(attrs[param]) if attrs.key?(param)
to_prefix_path % attrs
end
|
#to_prefix_path ⇒ Object
19
20
21
|
# File 'lib/json_api_client/associations/belongs_to.rb', line 19
def to_prefix_path
"#{attr_name.to_s.pluralize}/%{#{param}}"
end
|