Class: JsonApiClient::Associations::BelongsTo::Association

Inherits:
JsonApiClient::Associations::BaseAssociation show all
Defined in:
lib/json_api_client/associations/belongs_to.rb

Instance Attribute Summary

Attributes inherited from JsonApiClient::Associations::BaseAssociation

#attr_name, #klass, #options

Instance Method Summary collapse

Methods inherited from JsonApiClient::Associations::BaseAssociation

#association_class, #data, #from_result_set, #initialize

Constructor Details

This class inherits a constructor from JsonApiClient::Associations::BaseAssociation

Instance Method Details

#paramObject



14
15
16
# File 'lib/json_api_client/associations/belongs_to.rb', line 14

def param
  :"#{attr_name}_id"
end

#to_prefix_pathObject



18
19
20
# File 'lib/json_api_client/associations/belongs_to.rb', line 18

def to_prefix_path
  "#{attr_name.to_s.pluralize}/%{#{param}}"
end