Class: EloBrain::DevelopmentCoefficient::EligibleSituation
- Inherits:
-
Object
- Object
- EloBrain::DevelopmentCoefficient::EligibleSituation
- Defined in:
- lib/elo_brain/development_coefficient/eligible_situation.rb
Instance Method Summary collapse
-
#initialize(default_condition, *conditions) ⇒ EligibleSituation
constructor
A new instance of EligibleSituation.
- #situation ⇒ Object
Constructor Details
#initialize(default_condition, *conditions) ⇒ EligibleSituation
Returns a new instance of EligibleSituation.
6 7 8 9 |
# File 'lib/elo_brain/development_coefficient/eligible_situation.rb', line 6 def initialize(default_condition, *conditions) @default_condition = default_condition @conditions = conditions end |
Instance Method Details
#situation ⇒ Object
11 12 13 14 15 16 |
# File 'lib/elo_brain/development_coefficient/eligible_situation.rb', line 11 def situation @conditions.each do |condition| return condition if condition.eligible? end @default_condition end |