module Experimental

This class will filter the population of an experiment Override in? to filter the population Called by Experiment.in?

Constants

VERSION

Public Class Methods

configure(configuration) click to toggle source
# File lib/experimental.rb, line 15
def configure(configuration)
  source = Source::ActiveRecord.new
  if (ttl = configuration['cache_for'])
    source = Source::Cache.new(source, ttl: ttl)
  end
  self.experiment_data = configuration['experiments']
  self.source = source
end
experiment_data() click to toggle source
# File lib/experimental.rb, line 40
def experiment_data
  @experimental_data ||= {}
end
experiment_data=(data) click to toggle source
# File lib/experimental.rb, line 36
def experiment_data=(data)
  @experimental_data = data
end
overrides() click to toggle source
# File lib/experimental.rb, line 51
def self.overrides
  Thread.current[:experimental_overrides] ||= Overrides.new
end
register_population_filter(name, filter_class) click to toggle source
# File lib/experimental.rb, line 24
def register_population_filter(name, filter_class)
  Experiment.register_population_filter(name, filter_class)
end
reset() click to toggle source
# File lib/experimental.rb, line 44
def reset
  self.source = nil
  self.experiment_data = nil
  Experiment.reset_population_filters
end
source() click to toggle source
# File lib/experimental.rb, line 32
def source
  @experimental_source ||= Source::ActiveRecord.new
end
source=(source) click to toggle source
# File lib/experimental.rb, line 28
def source=(source)
  @experimental_source = source
end