Exception: JSONAPI::Exceptions::KeyNotIncludedInURL
- Defined in:
- lib/jsonapi/exceptions.rb
Instance Attribute Summary collapse
-
#key ⇒ Object
Returns the value of attribute key.
Attributes inherited from Error
Instance Method Summary collapse
- #errors ⇒ Object
-
#initialize(key, error_object_overrides = {}) ⇒ KeyNotIncludedInURL
constructor
A new instance of KeyNotIncludedInURL.
Methods inherited from Error
Constructor Details
#initialize(key, error_object_overrides = {}) ⇒ KeyNotIncludedInURL
Returns a new instance of KeyNotIncludedInURL.
429 430 431 432 |
# File 'lib/jsonapi/exceptions.rb', line 429 def initialize(key, error_object_overrides = {}) @key = key super(error_object_overrides) end |
Instance Attribute Details
#key ⇒ Object
Returns the value of attribute key.
427 428 429 |
# File 'lib/jsonapi/exceptions.rb', line 427 def key @key end |
Instance Method Details
#errors ⇒ Object
434 435 436 437 438 439 440 441 442 |
# 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 |