Class: TrailGuide::Algorithms::Distributed
- Inherits:
-
Object
- Object
- TrailGuide::Algorithms::Distributed
- Defined in:
- lib/trail_guide/algorithms/distributed.rb
Instance Attribute Summary collapse
-
#experiment ⇒ Object
readonly
Returns the value of attribute experiment.
Class Method Summary collapse
Instance Method Summary collapse
- #choose!(**opts) ⇒ Object
-
#initialize(experiment) ⇒ Distributed
constructor
A new instance of Distributed.
Constructor Details
#initialize(experiment) ⇒ Distributed
Returns a new instance of Distributed.
10 11 12 |
# File 'lib/trail_guide/algorithms/distributed.rb', line 10 def initialize(experiment) @experiment = experiment end |
Instance Attribute Details
#experiment ⇒ Object (readonly)
Returns the value of attribute experiment.
4 5 6 |
# File 'lib/trail_guide/algorithms/distributed.rb', line 4 def experiment @experiment end |
Class Method Details
.choose!(experiment, **opts) ⇒ Object
6 7 8 |
# File 'lib/trail_guide/algorithms/distributed.rb', line 6 def self.choose!(experiment, **opts) new(experiment).choose!(**opts) end |
Instance Method Details
#choose!(**opts) ⇒ Object
14 15 16 |
# File 'lib/trail_guide/algorithms/distributed.rb', line 14 def choose!(**opts) variants.sample end |