Exception: JSONAPI::Exceptions::KeyNotIncludedInURL

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(key) ⇒ KeyNotIncludedInURL

Returns a new instance of KeyNotIncludedInURL.



261
262
263
# File 'lib/jsonapi/exceptions.rb', line 261

def initialize(key)
  @key = key
end

Instance Attribute Details

#keyObject

Returns the value of attribute key.



260
261
262
# File 'lib/jsonapi/exceptions.rb', line 260

def key
  @key
end

Instance Method Details

#errorsObject



265
266
267
268
269
270
# File 'lib/jsonapi/exceptions.rb', line 265

def errors
  [JSONAPI::Error.new(code: JSONAPI::KEY_NOT_INCLUDED_IN_URL,
                      status: :bad_request,
                      title: 'Key is not included in URL',
                      detail: "The URL does not support the key #{key}")]
end