Class: OpenFeatureSorbet::Configuration

Inherits:
Object
  • Object
show all
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

Instance Method Summary collapse

Constructor Details

#initializeConfiguration

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_contextObject

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

#hooksObject

Returns the value of attribute hooks.



22
23
24
# File 'lib/open_feature_sorbet/configuration.rb', line 22

def hooks
  @hooks
end

#providerObject

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_metadataObject



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