Class: Optimizely::StaticProjectConfigManager
- Inherits:
-
ProjectConfigManager
- Object
- ProjectConfigManager
- Optimizely::StaticProjectConfigManager
- Defined in:
- lib/optimizely/config_manager/static_project_config_manager.rb
Instance Attribute Summary collapse
-
#config ⇒ Object
readonly
Implementation of ProjectConfigManager interface.
-
#sdk_key ⇒ Object
readonly
Implementation of ProjectConfigManager interface.
Instance Method Summary collapse
-
#initialize(datafile, logger, error_handler, skip_json_validation) ⇒ StaticProjectConfigManager
constructor
A new instance of StaticProjectConfigManager.
- #optimizely_config ⇒ Object
Constructor Details
#initialize(datafile, logger, error_handler, skip_json_validation) ⇒ StaticProjectConfigManager
Returns a new instance of StaticProjectConfigManager.
28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 |
# File 'lib/optimizely/config_manager/static_project_config_manager.rb', line 28 def initialize(datafile, logger, error_handler, skip_json_validation) # Looks up and sets datafile and config based on response body. # # datafile - JSON string representing the Optimizely project. # logger - Provides a logger instance. # error_handler - Provides a handle_error method to handle exceptions. # skip_json_validation - Optional boolean param which allows skipping JSON schema # validation upon object invocation. By default JSON schema validation will be performed. # Returns instance of DatafileProjectConfig, nil otherwise. super() @config = DatafileProjectConfig.create( datafile, logger, error_handler, skip_json_validation ) @logger = logger @sdk_key = @config&.sdk_key @optimizely_config = nil end |
Instance Attribute Details
#config ⇒ Object (readonly)
Implementation of ProjectConfigManager interface.
26 27 28 |
# File 'lib/optimizely/config_manager/static_project_config_manager.rb', line 26 def config @config end |
#sdk_key ⇒ Object (readonly)
Implementation of ProjectConfigManager interface.
26 27 28 |
# File 'lib/optimizely/config_manager/static_project_config_manager.rb', line 26 def sdk_key @sdk_key end |
Instance Method Details
#optimizely_config ⇒ Object
49 50 51 52 53 |
# File 'lib/optimizely/config_manager/static_project_config_manager.rb', line 49 def optimizely_config @optimizely_config = OptimizelyConfig.new(@config, @logger).config if @optimizely_config.nil? @optimizely_config end |