Class: MailchimpAPI::Config Private
- Inherits:
-
Object
- Object
- MailchimpAPI::Config
- Defined in:
- lib/mailchimp-api/config.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 storing and managing client configuration
Constant Summary collapse
- DEFAULTS =
This constant is part of a private API. You should avoid using this constant if possible, as it may be removed or be changed in the future.
Default configuration options
{ http_opts: {}.freeze, retries: {enabled: true, count: 4, sleep: [0, 0.25, 0.75, 1.5].freeze}.freeze }.freeze
Instance Attribute Summary collapse
-
#http_opts ⇒ Hash
readonly
private
HTTP client configuration options.
-
#retries ⇒ Hash
readonly
private
Retry configuration options.
Instance Method Summary collapse
-
#initialize(http_opts: nil, retries: {}) ⇒ Config
constructor
private
Creates a new configuration instance.
Constructor Details
#initialize(http_opts: nil, retries: {}) ⇒ Config
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 configuration instance
29 30 31 32 33 34 |
# File 'lib/mailchimp-api/config.rb', line 29 def initialize(http_opts: nil, retries: {}) @http_opts = http_opts.dup.freeze || DEFAULTS[:http_opts] @retries = DEFAULTS[:retries].merge(retries || {}).freeze freeze 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.
15 16 17 |
# File 'lib/mailchimp-api/config.rb', line 15 def http_opts @http_opts 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.
18 19 20 |
# File 'lib/mailchimp-api/config.rb', line 18 def retries @retries end |