class JSONAPI::Exceptions::KeyNotIncludedInURL

Attributes

key[RW]

Public Class Methods

new(key, error_object_overrides = {}) click to toggle source
Calls superclass method JSONAPI::Exceptions::Error::new
# File lib/jsonapi/exceptions.rb, line 429
def initialize(key, error_object_overrides = {})
  @key = key
  super(error_object_overrides)
end

Public Instance Methods

errors() click to toggle source
# File lib/jsonapi/exceptions.rb, line 434
def errors
  [create_error_object(code: JSONAPI::KEY_NOT_INCLUDED_IN_URL,
                       status: :bad_request,
                       title: I18n.translate('jsonapi-resources.exceptions.key_not_included_in_url.title',
                                             default: 'Key is not included in URL'),
                       detail: I18n.translate('jsonapi-resources.exceptions.key_not_included_in_url.detail',
                                              default: "The URL does not support the key #{key}",
                                              key: key))]
end