Class: ReeRoda::StatusFromError

Inherits:
Object
  • Object
show all
Includes:
Ree::FnDSL
Defined in:
lib/ree_lib/packages/ree_roda/package/ree_roda/services/status_from_error.rb

Instance Method Summary collapse

Instance Method Details

#call(error_type) ⇒ Object



7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
# File 'lib/ree_lib/packages/ree_roda/package/ree_roda/services/status_from_error.rb', line 7

def call(error_type)
  case error_type
  when :not_found
    404
  when :invalid_param
    400
  when :conflict
    405
  when :auth
    401
  when :permission
    403
  when :payment
    402
  when :validation
    422
  end
end