Class: PaypalAPI::Config
- Inherits:
-
Object
- Object
- PaypalAPI::Config
- Defined in:
- lib/paypal-api/config.rb
Overview
Stores client requests configuration
Constant Summary collapse
- DEFAULTS =
Default config options
{ http_opts: {}.freeze, retries: {enabled: true, count: 4, sleep: [0, 0.25, 0.75, 1.5].freeze}.freeze }.freeze
Instance Attribute Summary collapse
-
#certs_cache ⇒ Object
readonly
Returns the value of attribute certs_cache.
-
#http_opts ⇒ Object
readonly
Returns the value of attribute http_opts.
-
#retries ⇒ Object
readonly
Returns the value of attribute retries.
Instance Method Summary collapse
-
#initialize(http_opts: nil, retries: {}, cache: nil) ⇒ Client
constructor
Initializes Config.
Constructor Details
#initialize(http_opts: nil, retries: {}, cache: nil) ⇒ Client
Initializes Config
25 26 27 28 29 30 31 |
# File 'lib/paypal-api/config.rb', line 25 def initialize(http_opts: nil, retries: {}, cache: nil) @http_opts = http_opts || DEFAULTS[:http_opts] @retries = DEFAULTS[:retries].merge(retries || {}) @certs_cache = WebhookVerifier::CertsCache.new(cache) freeze end |
Instance Attribute Details
#certs_cache ⇒ Object (readonly)
Returns the value of attribute certs_cache.
14 15 16 |
# File 'lib/paypal-api/config.rb', line 14 def certs_cache @certs_cache end |
#http_opts ⇒ Object (readonly)
Returns the value of attribute http_opts.
14 15 16 |
# File 'lib/paypal-api/config.rb', line 14 def http_opts @http_opts end |
#retries ⇒ Object (readonly)
Returns the value of attribute retries.
14 15 16 |
# File 'lib/paypal-api/config.rb', line 14 def retries @retries end |