Class: OpenFeatureSorbet::Configuration
- Inherits:
-
Object
- Object
- OpenFeatureSorbet::Configuration
- Extended by:
- T::Sig
- Includes:
- Singleton
- Defined in:
- lib/open_feature_sorbet/configuration.rb
Overview
Singleton class that supports global configuration for OpenFeature. Should not be interacted with directly; rather, favor interacting with methods defined on the ‘OpenFeature` module.
Instance Attribute Summary collapse
-
#evaluation_context ⇒ Object
Returns the value of attribute evaluation_context.
-
#hooks ⇒ Object
Returns the value of attribute hooks.
-
#provider ⇒ Object
Returns the value of attribute provider.
Instance Method Summary collapse
-
#initialize ⇒ Configuration
constructor
A new instance of Configuration.
- #provider_metadata ⇒ Object
- #reset! ⇒ Object
Constructor Details
#initialize ⇒ Configuration
Returns a new instance of Configuration.
25 26 27 28 29 |
# File 'lib/open_feature_sorbet/configuration.rb', line 25 def initialize @provider = T.let(NoOpProvider.new, Provider) @evaluation_context = T.let(nil, T.nilable(EvaluationContext)) @hooks = T.let([], T::Array[Hook]) end |
Instance Attribute Details
#evaluation_context ⇒ Object
Returns the value of attribute evaluation_context.
19 20 21 |
# File 'lib/open_feature_sorbet/configuration.rb', line 19 def evaluation_context @evaluation_context end |
#hooks ⇒ Object
Returns the value of attribute hooks.
22 23 24 |
# File 'lib/open_feature_sorbet/configuration.rb', line 22 def hooks @hooks end |
#provider ⇒ Object
Returns the value of attribute provider.
16 17 18 |
# File 'lib/open_feature_sorbet/configuration.rb', line 16 def provider @provider end |
Instance Method Details
#provider_metadata ⇒ Object
32 33 34 |
# File 'lib/open_feature_sorbet/configuration.rb', line 32 def provider. end |
#reset! ⇒ Object
37 38 39 40 41 |
# File 'lib/open_feature_sorbet/configuration.rb', line 37 def reset! @provider = OpenFeatureSorbet::NoOpProvider.new @hooks = [] @evaluation_context = nil end |