Class: Featureflow::Configuration
- Inherits:
-
Object
- Object
- Featureflow::Configuration
- Defined in:
- lib/featureflow/configuration.rb
Constant Summary collapse
- DEFAULT_ENDPOINT =
'https://app.featureflow.io'- DEFAULT_EVENT_ENDPOINT =
'https://events.featureflow.io'
Instance Attribute Summary collapse
-
#api_key ⇒ Object
Returns the value of attribute api_key.
-
#disable_events ⇒ Object
Returns the value of attribute disable_events.
-
#endpoint ⇒ Object
Returns the value of attribute endpoint.
-
#event_endpoint ⇒ Object
Returns the value of attribute event_endpoint.
-
#logger ⇒ Object
Returns the value of attribute logger.
-
#with_features ⇒ Object
Returns the value of attribute with_features.
Instance Method Summary collapse
-
#initialize ⇒ Configuration
constructor
A new instance of Configuration.
- #validate! ⇒ Object
Constructor Details
#initialize ⇒ Configuration
Returns a new instance of Configuration.
12 13 14 15 16 17 18 19 20 21 |
# File 'lib/featureflow/configuration.rb', line 12 def initialize self.api_key = ENV["FEATUREFLOW_SERVER_KEY"] self.endpoint = DEFAULT_ENDPOINT self.event_endpoint = DEFAULT_EVENT_ENDPOINT self.disable_events = false self.with_features = [] self.logger = Logger.new(STDOUT) self.logger.level = Logger::WARN end |
Instance Attribute Details
#api_key ⇒ Object
Returns the value of attribute api_key.
2 3 4 |
# File 'lib/featureflow/configuration.rb', line 2 def api_key @api_key end |
#disable_events ⇒ Object
Returns the value of attribute disable_events.
5 6 7 |
# File 'lib/featureflow/configuration.rb', line 5 def disable_events @disable_events end |
#endpoint ⇒ Object
Returns the value of attribute endpoint.
3 4 5 |
# File 'lib/featureflow/configuration.rb', line 3 def endpoint @endpoint end |
#event_endpoint ⇒ Object
Returns the value of attribute event_endpoint.
4 5 6 |
# File 'lib/featureflow/configuration.rb', line 4 def event_endpoint @event_endpoint end |
#logger ⇒ Object
Returns the value of attribute logger.
7 8 9 |
# File 'lib/featureflow/configuration.rb', line 7 def logger @logger end |
#with_features ⇒ Object
Returns the value of attribute with_features.
6 7 8 |
# File 'lib/featureflow/configuration.rb', line 6 def with_features @with_features end |
Instance Method Details
#validate! ⇒ Object
23 24 25 26 27 |
# File 'lib/featureflow/configuration.rb', line 23 def validate! unless with_features_valid? @with_features raise ArgumentError, 'with_features must be an array of Feature hashes. Use Featureflow::Feature.create(key, failover_variant)' end end |