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.
409 410 411 412 |
# File 'lib/jsonapi/exceptions.rb', line 409 def initialize(key, error_object_overrides = {}) @key = key super(error_object_overrides) end |
Instance Attribute Details
#key ⇒ Object
Returns the value of attribute key.
407 408 409 |
# File 'lib/jsonapi/exceptions.rb', line 407 def key @key end |
Instance Method Details
#errors ⇒ Object
414 415 416 417 418 419 420 421 422 |
# File 'lib/jsonapi/exceptions.rb', line 414 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 |