Class: EppoClient::Config
- Inherits:
-
Object
- Object
- EppoClient::Config
- Defined in:
- lib/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.
Instance Method Summary collapse
-
#initialize(api_key, assignment_logger: AssignmentLogger.new, base_url: 'https://eppo.cloud/api') ⇒ 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: 'https://eppo.cloud/api') ⇒ Config
Returns a new instance of Config.
11 12 13 14 15 |
# File 'lib/config.rb', line 11 def initialize(api_key, assignment_logger: AssignmentLogger.new, base_url: 'https://eppo.cloud/api') @api_key = api_key @assignment_logger = assignment_logger @base_url = base_url end |
Instance Attribute Details
#api_key ⇒ Object (readonly)
Returns the value of attribute api_key.
9 10 11 |
# File 'lib/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/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/config.rb', line 9 def base_url @base_url end |
Instance Method Details
#inspect ⇒ Object
Hide instance variables (specifically api_key) from logs
22 23 24 |
# File 'lib/config.rb', line 22 def inspect "#<EppoClient::Config:#{object_id}>" end |
#validate ⇒ Object
17 18 19 |
# File 'lib/config.rb', line 17 def validate EppoClient.validate_not_blank('api_key', @api_key) end |