Class: TpagaService::Swagger::Response

Inherits:
Object
  • Object
show all
Defined in:
lib/tpaga_service/swagger/response.rb

Instance Method Summary collapse

Constructor Details

#initialize(code_response, body_response) ⇒ Response

Parameters:

*code_response : Integer *message_error : Hash



8
9
10
11
12
13
# File 'lib/tpaga_service/swagger/response.rb', line 8

def initialize(code_response, body_response)
  case code_response
  when 500..510 then raise ServerError.new(code_response, body_response) #(ServerError, body_response)
  when 299..426 then raise ClientError.new(code_response, body_response) #(ClientError, body_response)
  end
end