Class: VWO::Services::SettingsFileProcessor
- Inherits:
-
Object
- Object
- VWO::Services::SettingsFileProcessor
- Includes:
- Enums, Utils::Campaign
- Defined in:
- lib/vwo/services/settings_file_processor.rb
Constant Summary
Constants included from CONSTANTS
CONSTANTS::API_VERSION, CONSTANTS::HTTPS_PROTOCOL, CONSTANTS::HTTP_PROTOCOL, CONSTANTS::LIBRARY_PATH, CONSTANTS::MAX_TRAFFIC_PERCENT, CONSTANTS::MAX_TRAFFIC_VALUE, CONSTANTS::PLATFORM, CONSTANTS::RUBY_VARIABLE_TYPES, CONSTANTS::SDK_NAME, CONSTANTS::SDK_VERSION, CONSTANTS::SEED_VALUE, CONSTANTS::STATUS_RUNNING, CONSTANTS::URL_NAMESPACE
Instance Method Summary collapse
- #get_settings_file ⇒ Object
-
#initialize(settings_file) ⇒ SettingsFileProcessor
constructor
Method to initialize settings_file and logger.
-
#process_settings_file ⇒ Object
Processes the settings_file, assigns variation allocation range.
Methods included from Utils::Campaign
#get_campaign_goal, #get_control_variation, #get_segments, #get_variable, #set_variation_allocation
Constructor Details
#initialize(settings_file) ⇒ SettingsFileProcessor
Method to initialize settings_file and logger
31 32 33 34 |
# File 'lib/vwo/services/settings_file_processor.rb', line 31 def initialize(settings_file) @settings_file = JSON.parse(settings_file) @logger = VWO::Logger.get_instance end |
Instance Method Details
#get_settings_file ⇒ Object
47 48 49 |
# File 'lib/vwo/services/settings_file_processor.rb', line 47 def get_settings_file @settings_file end |
#process_settings_file ⇒ Object
Processes the settings_file, assigns variation allocation range
37 38 39 40 41 42 43 44 45 |
# File 'lib/vwo/services/settings_file_processor.rb', line 37 def process_settings_file (@settings_file['campaigns'] || []).each do |campaign| set_variation_allocation(campaign) end @logger.log( LogLevelEnum::DEBUG, format(LogMessageEnum::DebugMessages::SETTINGS_FILE_PROCESSED, file: FileNameEnum::SettingsFileProcessor) ) end |