Class: TrailGuide::Algorithms::Algorithm
- Inherits:
-
Object
- Object
- TrailGuide::Algorithms::Algorithm
show all
- Defined in:
- lib/trail_guide/algorithms/algorithm.rb
Instance Attribute Summary collapse
Class Method Summary
collapse
Instance Method Summary
collapse
Constructor Details
#initialize(experiment) ⇒ Algorithm
10
11
12
|
# File 'lib/trail_guide/algorithms/algorithm.rb', line 10
def initialize(experiment)
@experiment = experiment
end
|
Instance Attribute Details
#experiment ⇒ Object
Returns the value of attribute experiment.
4
5
6
|
# File 'lib/trail_guide/algorithms/algorithm.rb', line 4
def experiment
@experiment
end
|
Class Method Details
.choose!(experiment, **opts) ⇒ Object
6
7
8
|
# File 'lib/trail_guide/algorithms/algorithm.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/algorithm.rb', line 14
def choose!(**opts)
raise NotImplementedError, 'You must define a `#choose!(**opts)` method for your algorithm'
end
|