Class: Trebuchet::Strategy::Experiment
- Includes:
- Experimentable
- Defined in:
- lib/trebuchet/strategy/experiment.rb
Overview
require ‘digest/sha1’
Instance Attribute Summary
Attributes included from Experimentable
#bucket, #experiment_name, #total_buckets
Attributes inherited from Base
Instance Method Summary collapse
-
#initialize(options = {}) ⇒ Experiment
constructor
A new instance of Experiment.
- #launch_at?(user, request = nil) ⇒ Boolean
Methods included from Experimentable
#as_json, #export, #initialize_experiment, #inspect, #to_s, #type, #valid?, #value_in_bucket?
Methods inherited from Base
#as_json, #export, #feature_id, #inspect, #name, #needs_user?, strategy_name
Constructor Details
#initialize(options = {}) ⇒ Experiment
Returns a new instance of Experiment.
7 8 9 |
# File 'lib/trebuchet/strategy/experiment.rb', line 7 def initialize( = {}) initialize_experiment() end |
Instance Method Details
#launch_at?(user, request = nil) ⇒ Boolean
11 12 13 14 |
# File 'lib/trebuchet/strategy/experiment.rb', line 11 def launch_at?(user, request = nil) return false unless user && user.id value_in_bucket?(user.id) end |