Module: CrashingTheDance::RpiCalculator

Defined in:
lib/crashing_the_dance/rpi_calculator.rb,
lib/crashing_the_dance/rpi_calculator/rpi.rb,
lib/crashing_the_dance/rpi_calculator/version.rb,
lib/crashing_the_dance/rpi_calculator/opponent_game.rb

Defined Under Namespace

Classes: OpponentGame, RPI

Constant Summary collapse

VERSION =
"0.1.1"

Class Method Summary collapse

Class Method Details

.calculate(teams, games) ⇒ Object

teams should be valid hash keys (#hash and #eql?) don’t put any other requirements (e.g., #name) also use fixtures to test them. simple, lightweight.



10
11
12
13
14
15
16
# File 'lib/crashing_the_dance/rpi_calculator.rb', line 10

def self.calculate(teams, games)
  by_team = games_by_team(teams, games)
  teams = calculate_rpi teams, by_team
  calculate_owp teams, by_team
  calculate_oowp teams
  teams
end