Class: EloBrain::DevelopmentCoefficient::EligibleSituation

Inherits:
Object
  • Object
show all
Defined in:
lib/elo_brain/development_coefficient/eligible_situation.rb

Instance Method Summary collapse

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

#situationObject



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