Class: FunWithJsonApi::ExceptionSerializer
- Inherits:
-
ActiveModel::Serializer::CollectionSerializer
- Object
- ActiveModel::Serializer::CollectionSerializer
- FunWithJsonApi::ExceptionSerializer
- Defined in:
- lib/fun_with_json_api/exception_serializer.rb
Instance Method Summary collapse
-
#initialize(exception, options = {}) ⇒ ExceptionSerializer
constructor
A new instance of ExceptionSerializer.
- #root ⇒ Object
Constructor Details
#initialize(exception, options = {}) ⇒ ExceptionSerializer
Returns a new instance of ExceptionSerializer.
5 6 7 8 9 |
# File 'lib/fun_with_json_api/exception_serializer.rb', line 5 def initialize(exception, = {}) super(exception.payload, .reverse_merge( serializer: ExceptionPayloadSerializer )) end |
Instance Method Details
#root ⇒ Object
11 12 13 |
# File 'lib/fun_with_json_api/exception_serializer.rb', line 11 def root 'errors' end |