Exception: JSONAPI::Exceptions::KeyNotIncludedInURL
- Defined in:
- lib/jsonapi/exceptions.rb
Instance Attribute Summary collapse
-
#key ⇒ Object
Returns the value of attribute key.
Instance Method Summary collapse
- #errors ⇒ Object
-
#initialize(key) ⇒ KeyNotIncludedInURL
constructor
A new instance of KeyNotIncludedInURL.
Constructor Details
#initialize(key) ⇒ KeyNotIncludedInURL
Returns a new instance of KeyNotIncludedInURL.
336 337 338 |
# File 'lib/jsonapi/exceptions.rb', line 336 def initialize(key) @key = key end |
Instance Attribute Details
#key ⇒ Object
Returns the value of attribute key.
335 336 337 |
# File 'lib/jsonapi/exceptions.rb', line 335 def key @key end |
Instance Method Details
#errors ⇒ Object
340 341 342 343 344 345 346 347 348 |
# File 'lib/jsonapi/exceptions.rb', line 340 def errors [JSONAPI::Error.new(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 |