Exception: JSONAPI::Exceptions::RecordNotFound

Inherits:
Error
  • Object
show all
Defined in:
lib/jsonapi/exceptions.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(id) ⇒ RecordNotFound

Returns a new instance of RecordNotFound.



36
37
38
# File 'lib/jsonapi/exceptions.rb', line 36

def initialize(id)
  @id = id
end

Instance Attribute Details

#idObject

Returns the value of attribute id.



35
36
37
# File 'lib/jsonapi/exceptions.rb', line 35

def id
  @id
end

Instance Method Details

#errorsObject



40
41
42
43
44
45
# File 'lib/jsonapi/exceptions.rb', line 40

def errors
  [JSONAPI::Error.new(code: JSONAPI::RECORD_NOT_FOUND,
                      status: :not_found,
                      title: 'Record not found',
                      detail: "The record identified by #{id} could not be found.")]
end