Class: Decommas::Response::Api
- Defined in:
- lib/decommas/response/api.rb
Constant Summary
Constants inherited from Base
Instance Method Summary collapse
-
#initialize(response) ⇒ Api
constructor
A new instance of Api.
Methods inherited from Base
Constructor Details
#initialize(response) ⇒ Api
Returns a new instance of Api.
4 5 6 7 8 9 10 11 12 13 14 15 |
# File 'lib/decommas/response/api.rb', line 4 def initialize(response) # Workaround for 429 response that returns text/html content-type for some reason response_data = if response.parsed_response.kind_of?(String) JSON.parse(response.parsed_response) else response.parsed_response end @code = response.code @data = response_data["result"] @message = response_data["message"] end |