Exception: SimpleJsonapi::SerializerInferenceError
- Inherits:
-
StandardError
- Object
- StandardError
- SimpleJsonapi::SerializerInferenceError
- Defined in:
- lib/simple_jsonapi/helpers/exceptions.rb
Overview
The error raised when a SerializerInferrer cannot find the serializer for a resource or error.
Instance Attribute Summary collapse
-
#object ⇒ Object
readonly
Returns the value of attribute object.
Instance Method Summary collapse
-
#initialize(object, msg = nil) ⇒ SerializerInferenceError
constructor
A new instance of SerializerInferenceError.
- #to_s ⇒ Object
Constructor Details
#initialize(object, msg = nil) ⇒ SerializerInferenceError
Returns a new instance of SerializerInferenceError.
30 31 32 33 |
# File 'lib/simple_jsonapi/helpers/exceptions.rb', line 30 def initialize(object, msg = nil) @object = object @msg = msg end |
Instance Attribute Details
#object ⇒ Object (readonly)
Returns the value of attribute object.
26 27 28 |
# File 'lib/simple_jsonapi/helpers/exceptions.rb', line 26 def object @object end |
Instance Method Details
#to_s ⇒ Object
35 36 37 |
# File 'lib/simple_jsonapi/helpers/exceptions.rb', line 35 def to_s @msg.present? ? @msg : "Unable to infer serializer for #{object.class}" end |