Class: PanStuff::Serializer::ExceptionSerializer

Inherits:
Object
  • Object
show all
Includes:
Base
Defined in:
lib/pan_stuff/serializer/exception_serializer.rb

Constant Summary

Constants included from Base

Base::TRANSFORMS_MAPPING

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Base

#as_json, #run_key_transform!, #to_h

Constructor Details

#initialize(status: nil, error: nil, exception: nil, root: true) ⇒ ExceptionSerializer

Returns a new instance of ExceptionSerializer.



10
11
12
13
14
15
# File 'lib/pan_stuff/serializer/exception_serializer.rb', line 10

def initialize(status: nil, error: nil, exception: nil, root: true)
  @error     = error
  @status    = status
  @exception = exception
  @root      = root
end

Instance Attribute Details

#errorObject (readonly)

Returns the value of attribute error.



8
9
10
# File 'lib/pan_stuff/serializer/exception_serializer.rb', line 8

def error
  @error
end

#exceptionObject (readonly)

Returns the value of attribute exception.



8
9
10
# File 'lib/pan_stuff/serializer/exception_serializer.rb', line 8

def exception
  @exception
end

#rootObject (readonly)

Returns the value of attribute root.



8
9
10
# File 'lib/pan_stuff/serializer/exception_serializer.rb', line 8

def root
  @root
end

#statusObject (readonly)

Returns the value of attribute status.



8
9
10
# File 'lib/pan_stuff/serializer/exception_serializer.rb', line 8

def status
  @status
end