Module: JsonApiClient::Helpers::Associatable
- Extended by:
- ActiveSupport::Concern
- Included in:
- Resource
- Defined in:
- lib/json_api_client/helpers/associatable.rb
Defined Under Namespace
Modules: ClassMethods
Instance Method Summary collapse
- #_belongs_to_params ⇒ Object
- #_cached_associations ⇒ Object
- #_cached_relationship(attr_name) ⇒ Object
- #_clear_belongs_to_params ⇒ Object
- #_clear_cached_relationship(attr_name) ⇒ Object
- #_clear_cached_relationships ⇒ Object
Instance Method Details
#_belongs_to_params ⇒ Object
61 62 63 |
# File 'lib/json_api_client/helpers/associatable.rb', line 61 def _belongs_to_params self.__belongs_to_params ||= {} end |
#_cached_associations ⇒ Object
69 70 71 |
# File 'lib/json_api_client/helpers/associatable.rb', line 69 def _cached_associations self.__cached_associations ||= {} end |
#_cached_relationship(attr_name) ⇒ Object
81 82 83 84 |
# File 'lib/json_api_client/helpers/associatable.rb', line 81 def _cached_relationship(attr_name) return _cached_associations[attr_name] if _cached_associations.has_key?(attr_name) _cached_associations[attr_name] = yield end |
#_clear_belongs_to_params ⇒ Object
65 66 67 |
# File 'lib/json_api_client/helpers/associatable.rb', line 65 def _clear_belongs_to_params self.__belongs_to_params = {} end |
#_clear_cached_relationship(attr_name) ⇒ Object
77 78 79 |
# File 'lib/json_api_client/helpers/associatable.rb', line 77 def _clear_cached_relationship(attr_name) _cached_associations.delete(attr_name) end |
#_clear_cached_relationships ⇒ Object
73 74 75 |
# File 'lib/json_api_client/helpers/associatable.rb', line 73 def _clear_cached_relationships self.__cached_associations = {} end |