Class: JSONAPI::Store::Identifier
- Inherits:
-
Dry::Struct
- Object
- Dry::Struct
- JSONAPI::Store::Identifier
- Defined in:
- lib/jsonapi/store/identifier.rb
Overview
Basic Identifier implementation for JSONAPI::Store
Direct Known Subclasses
Instance Method Summary collapse
-
#id ⇒ String
Id of the entity.
- #identifier ⇒ String (also: #to_s, #to_str)
-
#type ⇒ String
Type of the entity.
Instance Method Details
#id ⇒ String
Returns id of the entity.
12 |
# File 'lib/jsonapi/store/identifier.rb', line 12 attribute :id, Types::Coercible::String |
#identifier ⇒ String Also known as: to_s, to_str
17 18 19 |
# File 'lib/jsonapi/store/identifier.rb', line 17 def identifier @identifier ||= "#{type}/#{id}" end |
#type ⇒ String
Returns type of the entity.
14 |
# File 'lib/jsonapi/store/identifier.rb', line 14 attribute :type, Types::Coercible::String |