Class: EppoClient::Config
- Inherits:
-
Object
- Object
- EppoClient::Config
- Defined in:
- lib/eppo_client/config.rb
Overview
The class for configuring the Eppo client singleton
Instance Attribute Summary collapse
-
#api_key ⇒ Object
readonly
Returns the value of attribute api_key.
-
#assignment_logger ⇒ Object
readonly
Returns the value of attribute assignment_logger.
-
#base_url ⇒ Object
readonly
Returns the value of attribute base_url.
-
#log_level ⇒ Object
readonly
Returns the value of attribute log_level.
-
#poll_interval_seconds ⇒ Object
readonly
Returns the value of attribute poll_interval_seconds.
-
#poll_jitter_seconds ⇒ Object
readonly
Returns the value of attribute poll_jitter_seconds.
Instance Method Summary collapse
-
#initialize(api_key, assignment_logger: AssignmentLogger.new, base_url: EppoClient::Core::DEFAULT_BASE_URL, poll_interval_seconds: EppoClient::Core::DEFAULT_POLL_INTERVAL_SECONDS, poll_jitter_seconds: EppoClient::Core::DEFAULT_POLL_JITTER_SECONDS, initial_configuration: nil, log_level: nil) ⇒ Config
constructor
A new instance of Config.
-
#inspect ⇒ Object
Hide instance variables (specifically api_key) from logs.
- #validate ⇒ Object
Constructor Details
#initialize(api_key, assignment_logger: AssignmentLogger.new, base_url: EppoClient::Core::DEFAULT_BASE_URL, poll_interval_seconds: EppoClient::Core::DEFAULT_POLL_INTERVAL_SECONDS, poll_jitter_seconds: EppoClient::Core::DEFAULT_POLL_JITTER_SECONDS, initial_configuration: nil, log_level: nil) ⇒ Config
Returns a new instance of Config.
11 12 13 14 15 16 17 18 |
# File 'lib/eppo_client/config.rb', line 11 def initialize(api_key, assignment_logger: AssignmentLogger.new, base_url: EppoClient::Core::DEFAULT_BASE_URL, poll_interval_seconds: EppoClient::Core::DEFAULT_POLL_INTERVAL_SECONDS, poll_jitter_seconds: EppoClient::Core::DEFAULT_POLL_JITTER_SECONDS, initial_configuration: nil, log_level: nil) @api_key = api_key @assignment_logger = assignment_logger @base_url = base_url @poll_interval_seconds = poll_interval_seconds @poll_jitter_seconds = poll_jitter_seconds @log_level = log_level end |
Instance Attribute Details
#api_key ⇒ Object (readonly)
Returns the value of attribute api_key.
9 10 11 |
# File 'lib/eppo_client/config.rb', line 9 def api_key @api_key end |
#assignment_logger ⇒ Object (readonly)
Returns the value of attribute assignment_logger.
9 10 11 |
# File 'lib/eppo_client/config.rb', line 9 def assignment_logger @assignment_logger end |
#base_url ⇒ Object (readonly)
Returns the value of attribute base_url.
9 10 11 |
# File 'lib/eppo_client/config.rb', line 9 def base_url @base_url end |
#log_level ⇒ Object (readonly)
Returns the value of attribute log_level.
9 10 11 |
# File 'lib/eppo_client/config.rb', line 9 def log_level @log_level end |
#poll_interval_seconds ⇒ Object (readonly)
Returns the value of attribute poll_interval_seconds.
9 10 11 |
# File 'lib/eppo_client/config.rb', line 9 def poll_interval_seconds @poll_interval_seconds end |
#poll_jitter_seconds ⇒ Object (readonly)
Returns the value of attribute poll_jitter_seconds.
9 10 11 |
# File 'lib/eppo_client/config.rb', line 9 def poll_jitter_seconds @poll_jitter_seconds end |
Instance Method Details
#inspect ⇒ Object
Hide instance variables (specifically api_key) from logs
25 26 27 |
# File 'lib/eppo_client/config.rb', line 25 def inspect "#<EppoClient::Config:#{object_id}>" end |
#validate ⇒ Object
20 21 22 |
# File 'lib/eppo_client/config.rb', line 20 def validate EppoClient.validate_not_blank("api_key", @api_key) end |