Exception: ErrorsHelper::UnprocessableEntity

Inherits:
Base
  • Object
show all
Defined in:
lib/errors_helper/unprocessable_entity.rb

Instance Attribute Summary

Attributes inherited from Base

#code, #message

Instance Method Summary collapse

Methods inherited from Base

#inspect, #status, #to_hash

Constructor Details

#initialize(code: '05', status: nil) ⇒ UnprocessableEntity

Returns a new instance of UnprocessableEntity.



5
6
7
8
9
10
# File 'lib/errors_helper/unprocessable_entity.rb', line 5

def initialize(code: '05', status: nil)
  value = ErrorsHelper.build_response(code: code)
  super message: value[:message] || ErrorsHelper.build_response(code: '05')[:message],
        code: value[:code] || ErrorsHelper.build_response(code: '05')[:code],
        status: status || :unprocessable_entity
end