Class: CurrencyCloud::ResponseHandler

Inherits:
Object
  • Object
show all
Defined in:
lib/currency_cloud/response_handler.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(verb, route, params, response) ⇒ ResponseHandler

Returns a new instance of ResponseHandler.



5
6
7
8
9
10
# File 'lib/currency_cloud/response_handler.rb', line 5

def initialize(verb, route, params, response)
  @verb = verb
  @route = route
  @params = params
  @response = response
end

Instance Attribute Details

#paramsObject (readonly)

Returns the value of attribute params.



3
4
5
# File 'lib/currency_cloud/response_handler.rb', line 3

def params
  @params
end

#responseObject (readonly)

Returns the value of attribute response.



3
4
5
# File 'lib/currency_cloud/response_handler.rb', line 3

def response
  @response
end

#routeObject (readonly)

Returns the value of attribute route.



3
4
5
# File 'lib/currency_cloud/response_handler.rb', line 3

def route
  @route
end

#verbObject (readonly)

Returns the value of attribute verb.



3
4
5
# File 'lib/currency_cloud/response_handler.rb', line 3

def verb
  @verb
end

Instance Method Details

#processObject



12
13
14
15
# File 'lib/currency_cloud/response_handler.rb', line 12

def process
  return parsed_response if success?
  handle_failure
end