class EloBrain::DevelopmentCoefficient::SituationCoefficient

Public Instance Methods

call(nb_matches:, elo:) click to toggle source
# File lib/elo_brain/development_coefficient/situation_coefficient.rb, line 6
def call(nb_matches:, elo:)
  klass = EligibleSituation.new(
    Situations::Default.new,
    Situations::Starting.new(nb_matches: nb_matches),
    Situations::Amateur.new(elo: elo),
    Situations::Pro.new(elo: elo)
  ).situation.class
  coefficient(klass)
end

Private Instance Methods

coefficient(klass) click to toggle source
# File lib/elo_brain/development_coefficient/situation_coefficient.rb, line 18
def coefficient(klass)
  klass::COEFFICIENT
end