Exception: JSONAPI::Exceptions::TypeMismatch
- Defined in:
- lib/jsonapi/exceptions.rb
Instance Attribute Summary collapse
-
#type ⇒ Object
Returns the value of attribute type.
Attributes inherited from Error
Instance Method Summary collapse
- #errors ⇒ Object
-
#initialize(type, error_object_overrides = {}) ⇒ TypeMismatch
constructor
A new instance of TypeMismatch.
Methods inherited from Error
Constructor Details
#initialize(type, error_object_overrides = {}) ⇒ TypeMismatch
Returns a new instance of TypeMismatch.
292 293 294 295 |
# File 'lib/jsonapi/exceptions.rb', line 292 def initialize(type, error_object_overrides = {}) @type = type super(error_object_overrides) end |
Instance Attribute Details
#type ⇒ Object
Returns the value of attribute type.
290 291 292 |
# File 'lib/jsonapi/exceptions.rb', line 290 def type @type end |
Instance Method Details
#errors ⇒ Object
297 298 299 300 301 302 303 304 |
# File 'lib/jsonapi/exceptions.rb', line 297 def errors [create_error_object(code: JSONAPI::TYPE_MISMATCH, status: :bad_request, title: I18n.translate('jsonapi-resources.exceptions.type_mismatch.title', default: 'Type Mismatch'), detail: I18n.translate('jsonapi-resources.exceptions.type_mismatch.detail', default: "#{type} is not a valid type for this operation.", type: type))] end |