Class: ToggleFleet::Configuration
- Inherits:
-
Object
- Object
- ToggleFleet::Configuration
- Defined in:
- lib/togglefleet.rb
Instance Attribute Summary collapse
-
#default ⇒ Object
Returns the value of attribute default.
-
#logger ⇒ Object
Returns the value of attribute logger.
-
#on_evaluation ⇒ Object
Returns the value of attribute on_evaluation.
-
#open_timeout ⇒ Object
Returns the value of attribute open_timeout.
-
#read_timeout ⇒ Object
Returns the value of attribute read_timeout.
-
#refresh_interval ⇒ Object
Returns the value of attribute refresh_interval.
-
#sdk_key ⇒ Object
Returns the value of attribute sdk_key.
-
#url ⇒ Object
Returns the value of attribute url.
Instance Method Summary collapse
-
#initialize ⇒ Configuration
constructor
A new instance of Configuration.
Constructor Details
#initialize ⇒ Configuration
Returns a new instance of Configuration.
31 32 33 34 35 36 37 38 39 40 |
# File 'lib/togglefleet.rb', line 31 def initialize @sdk_key = ENV["TOGGLEFLEET_SDK_KEY"] @url = ENV.fetch("TOGGLEFLEET_URL", "https://togglefleet.com") @refresh_interval = Integer(ENV.fetch("TOGGLEFLEET_REFRESH", 15)) # seconds @default = false # fail-safe result when a flag is unknown or never fetched @open_timeout = 3 @read_timeout = 5 @logger = nil @on_evaluation = nil # ->(flag, actor, result) {} for metrics/logging end |
Instance Attribute Details
#default ⇒ Object
Returns the value of attribute default.
28 29 30 |
# File 'lib/togglefleet.rb', line 28 def default @default end |
#logger ⇒ Object
Returns the value of attribute logger.
28 29 30 |
# File 'lib/togglefleet.rb', line 28 def logger @logger end |
#on_evaluation ⇒ Object
Returns the value of attribute on_evaluation.
28 29 30 |
# File 'lib/togglefleet.rb', line 28 def on_evaluation @on_evaluation end |
#open_timeout ⇒ Object
Returns the value of attribute open_timeout.
28 29 30 |
# File 'lib/togglefleet.rb', line 28 def open_timeout @open_timeout end |
#read_timeout ⇒ Object
Returns the value of attribute read_timeout.
28 29 30 |
# File 'lib/togglefleet.rb', line 28 def read_timeout @read_timeout end |
#refresh_interval ⇒ Object
Returns the value of attribute refresh_interval.
28 29 30 |
# File 'lib/togglefleet.rb', line 28 def refresh_interval @refresh_interval end |
#sdk_key ⇒ Object
Returns the value of attribute sdk_key.
28 29 30 |
# File 'lib/togglefleet.rb', line 28 def sdk_key @sdk_key end |
#url ⇒ Object
Returns the value of attribute url.
28 29 30 |
# File 'lib/togglefleet.rb', line 28 def url @url end |