Class: AmazonAds::ApiClient::Response
- Inherits:
-
Object
- Object
- AmazonAds::ApiClient::Response
- Defined in:
- app/services/amazon_ads/api_client/response.rb
Class Method Summary collapse
Instance Method Summary collapse
- #call ⇒ Hash, Array
-
#initialize(response:, method:, path:) ⇒ Response
constructor
A new instance of Response.
Constructor Details
#initialize(response:, method:, path:) ⇒ Response
Returns a new instance of Response.
19 20 21 22 23 |
# File 'app/services/amazon_ads/api_client/response.rb', line 19 def initialize(response:, method:, path:) @response = response @method = method @path = path end |
Class Method Details
.call(response:, method:, path:) ⇒ Hash, Array
11 12 13 |
# File 'app/services/amazon_ads/api_client/response.rb', line 11 def call(response:, method:, path:) new(response:, method:, path:).call end |
Instance Method Details
#call ⇒ Hash, Array
28 29 30 31 32 33 |
# File 'app/services/amazon_ads/api_client/response.rb', line 28 def call raise throttled_error if @response.status == 429 raise failure_error unless @response.success? @response.body end |