Class: Fulfil::Configuration
- Inherits:
-
Object
- Object
- Fulfil::Configuration
- Defined in:
- lib/fulfil/configuration.rb
Overview
The ‘Fulfil::Configuration` contains the available configuration options for the `Fulfil` gem.
Instance Attribute Summary collapse
-
#logger ⇒ Logger?
Allows the client to configure a logger.
-
#rate_limit_notification_handler ⇒ Proc?
Allows the client to configure a notification handler.
-
#retry_on_rate_limit ⇒ Object
Allow the ‘Fulfil::Client` to automatically retry when the rate limit is hit.
-
#retry_on_rate_limit_wait ⇒ Object
Returns the value of attribute retry_on_rate_limit_wait.
Instance Method Summary collapse
-
#initialize ⇒ Configuration
constructor
A new instance of Configuration.
- #retry_on_rate_limit? ⇒ Boolean
Constructor Details
#initialize ⇒ Configuration
Returns a new instance of Configuration.
38 39 40 41 42 |
# File 'lib/fulfil/configuration.rb', line 38 def initialize @retry_on_rate_limit = false @retry_on_rate_limit_wait = 1 @logger = Logger.new($stderr) end |
Instance Attribute Details
#logger ⇒ Logger?
Allows the client to configure a logger. Logs are output to $stderr by default.
36 37 38 |
# File 'lib/fulfil/configuration.rb', line 36 def logger @logger end |
#rate_limit_notification_handler ⇒ Proc?
Allows the client to configure a notification handler. Can be used by APM tools to monitor the number of rate limit hits.
25 26 27 |
# File 'lib/fulfil/configuration.rb', line 25 def rate_limit_notification_handler @rate_limit_notification_handler end |
#retry_on_rate_limit ⇒ Object
Allow the ‘Fulfil::Client` to automatically retry when the rate limit is hit. By default, the `Fulfil::Client` will wait 1 second before retrying again.
11 12 13 |
# File 'lib/fulfil/configuration.rb', line 11 def retry_on_rate_limit @retry_on_rate_limit end |
#retry_on_rate_limit_wait ⇒ Object
Returns the value of attribute retry_on_rate_limit_wait.
12 13 14 |
# File 'lib/fulfil/configuration.rb', line 12 def retry_on_rate_limit_wait @retry_on_rate_limit_wait end |
Instance Method Details
#retry_on_rate_limit? ⇒ Boolean
44 45 46 |
# File 'lib/fulfil/configuration.rb', line 44 def retry_on_rate_limit? @retry_on_rate_limit end |