Class: JSONAPI::Store::Identifier

Inherits:
Dry::Struct
  • Object
show all
Defined in:
lib/jsonapi/store/identifier.rb

Overview

Basic Identifier implementation for JSONAPI::Store

Direct Known Subclasses

Entity

Instance Method Summary collapse

Instance Method Details

#idString

Returns id of the entity.

Returns:

  • (String)

    id of the entity



12
# File 'lib/jsonapi/store/identifier.rb', line 12

attribute :id, Types::Coercible::String

#identifierString Also known as: to_s, to_str

Returns:

  • (String)


17
18
19
# File 'lib/jsonapi/store/identifier.rb', line 17

def identifier
  @identifier ||= "#{type}/#{id}"
end

#typeString

Returns type of the entity.

Returns:

  • (String)

    type of the entity



14
# File 'lib/jsonapi/store/identifier.rb', line 14

attribute :type, Types::Coercible::String