Sha256: 2d64ff4e7b7876d87992732ad250c37de8e0662717c7747e7c0ab688054024d2
Contents?: true
Size: 1.04 KB
Versions: 3
Compression:
Stored size: 1.04 KB
Contents
module OptimizelyServerSide module Support # Enables for us to wrap experiments # Usage: # experiment('sign_up_test') do |config| # # config.variation_one('variation_one_key') do # # Code related to variation one # end # # config.variation_two('variation_two_key') do # # Code related to variation two # end # # config.variation_default('variation_default_key', primary: true) do # # We still want to keep our default experience # end # # end def experiment(experiment_key, &blk) variation_key = optimizely_sdk_project_instance(experiment_key) OptimizelyServerSide::Experiment.new(variation_key).start(&blk) end def optimizely_sdk_project_instance(experiment_key) OptimizelyServerSide::OptimizelySdk .project_instance(event_dispatcher: MyEventDispatcher.new) .activate(experiment_key, OptimizelyServerSide.configuration.visitor_id, OptimizelyServerSide.configuration.logger) end end end
Version data entries
3 entries across 3 versions & 1 rubygems