Class: FunWithJsonApi::ExceptionSerializer

Inherits:
ActiveModel::Serializer::CollectionSerializer
  • Object
show all
Defined in:
lib/fun_with_json_api/exception_serializer.rb

Instance Method Summary collapse

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, options = {})
  super(exception.payload, options.reverse_merge(
    serializer: ExceptionPayloadSerializer
  ))
end

Instance Method Details

#rootObject



11
12
13
# File 'lib/fun_with_json_api/exception_serializer.rb', line 11

def root
  'errors'
end