Class: MailchimpAPI::RequestExecutor Private
- Inherits:
-
Object
- Object
- MailchimpAPI::RequestExecutor
- Defined in:
- lib/mailchimp-api/request_executor.rb
Overview
This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.
Internal class for executing HTTP requests with retry logic
Instance Attribute Summary collapse
-
#http_opts ⇒ Hash
readonly
private
HTTP client configuration options.
-
#request ⇒ Request
readonly
private
The request to be executed.
-
#retries ⇒ Hash
readonly
private
Retry configuration options.
Instance Method Summary collapse
-
#call ⇒ Response
private
Executes the request with retry logic.
-
#initialize(request, http_opts: {}, retries: {}) ⇒ RequestExecutor
constructor
private
Creates a new request executor.
Constructor Details
#initialize(request, http_opts: {}, retries: {}) ⇒ RequestExecutor
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Creates a new request executor
20 21 22 23 24 |
# File 'lib/mailchimp-api/request_executor.rb', line 20 def initialize(request, http_opts: {}, retries: {}) @request = request @http_opts = http_opts @retries = retries end |
Instance Attribute Details
#http_opts ⇒ Hash (readonly)
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Returns HTTP client configuration options.
11 12 13 |
# File 'lib/mailchimp-api/request_executor.rb', line 11 def http_opts @http_opts end |
#request ⇒ Request (readonly)
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Returns The request to be executed.
8 9 10 |
# File 'lib/mailchimp-api/request_executor.rb', line 8 def request @request end |
#retries ⇒ Hash (readonly)
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Returns Retry configuration options.
14 15 16 |
# File 'lib/mailchimp-api/request_executor.rb', line 14 def retries @retries end |
Instance Method Details
#call ⇒ Response
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Executes the request with retry logic
30 31 32 33 34 35 |
# File 'lib/mailchimp-api/request_executor.rb', line 30 def call response = execute_request raise FailedRequestErrorBuilder.call(request: request, response: response) if response.failed? response end |