Module: GuineaPig::Experiments
- Defined in:
- lib/guinea_pig/experiments.rb
Class Method Summary collapse
Class Method Details
.experiments ⇒ Object
7 8 9 |
# File 'lib/guinea_pig/experiments.rb', line 7 def self.experiments @experiments ||= YAML::load(File.open(experiments_path)).symbolize_keys end |
.experiments_path ⇒ Object
11 12 13 |
# File 'lib/guinea_pig/experiments.rb', line 11 def self.experiments_path "#{Rails.root}/config/ab_experiments.yml" end |
.pick_alternative(experiment) ⇒ Object
3 4 5 |
# File 'lib/guinea_pig/experiments.rb', line 3 def self.pick_alternative(experiment) experiments[experiment].sample end |