Method: Split::Experiment#initialize
- Defined in:
- lib/split/experiment.rb
#initialize(name, options = {}) ⇒ Experiment
Returns a new instance of Experiment.
16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 |
# File 'lib/split/experiment.rb', line 16 def initialize(name, = {}) = DEFAULT_OPTIONS.merge() @name = name.to_s alternatives = () if alternatives.empty? && (exp_config = Split.configuration.experiment_for(name)) = { alternatives: load_alternatives_from_configuration, goals: Split::GoalsCollection.new(@name).load_from_configuration, metadata: , resettable: exp_config[:resettable], algorithm: exp_config[:algorithm] } else [:alternatives] = alternatives end () end |