Exception: JSONAPI::Exceptions::TypeMismatch
- Defined in:
- lib/jsonapi/exceptions.rb
Instance Attribute Summary collapse
-
#type ⇒ Object
Returns the value of attribute type.
Instance Method Summary collapse
- #errors ⇒ Object
-
#initialize(type) ⇒ TypeMismatch
constructor
A new instance of TypeMismatch.
Constructor Details
#initialize(type) ⇒ TypeMismatch
Returns a new instance of TypeMismatch.
148 149 150 |
# File 'lib/jsonapi/exceptions.rb', line 148 def initialize(type) @type = type end |
Instance Attribute Details
#type ⇒ Object
Returns the value of attribute type.
147 148 149 |
# File 'lib/jsonapi/exceptions.rb', line 147 def type @type end |
Instance Method Details
#errors ⇒ Object
152 153 154 155 156 157 |
# File 'lib/jsonapi/exceptions.rb', line 152 def errors [JSONAPI::Error.new(code: JSONAPI::TYPE_MISMATCH, status: :bad_request, title: 'Type Mismatch', detail: "#{type} is not a valid type for this operation.")] end |