Class: TpagaService::Swagger::Response
- Inherits:
-
Object
- Object
- TpagaService::Swagger::Response
- Defined in:
- lib/tpaga_service/swagger/response.rb
Instance Method Summary collapse
-
#initialize(code_response, body_response) ⇒ Response
constructor
Parameters: *
code_response
: Integer *message_error
: Hash.
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 |