diff options
author | Luke Shumaker <shumakl@purdue.edu> | 2014-04-25 11:20:29 -0400 |
---|---|---|
committer | Luke Shumaker <shumakl@purdue.edu> | 2014-04-25 11:20:29 -0400 |
commit | c584cd3127ad47a9c093356aee46394c6b35cc3e (patch) | |
tree | 149940f8cd7e6465f40e429b0d14470edc84a808 /lib/scheduling/elimination.rb | |
parent | d3cfd8683e842ce60ba339d6e6c7342738ec4cf8 (diff) | |
parent | 3a87a43fb993c08b780be484fa3d89bc3c568e64 (diff) |
Merge branch 'master' of https://github.com/LukeShu/leaguer
Conflicts:
app/views/matches/show.html.erb
Diffstat (limited to 'lib/scheduling/elimination.rb')
-rw-r--r-- | lib/scheduling/elimination.rb | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/lib/scheduling/elimination.rb b/lib/scheduling/elimination.rb index 0e93f7a..543df52 100644 --- a/lib/scheduling/elimination.rb +++ b/lib/scheduling/elimination.rb @@ -7,14 +7,6 @@ module Scheduling @tournament_stage = tournament_stage end - def tournament_stage - @tournament_stage - end - - def tournament - self.tournament_stage.tournament - end - def create_matches num_teams = (self.tournament.players.count/self.tournament.min_players_per_team).floor num_matches = (Float(num_teams - tournament.min_teams_per_match)/(tournament.min_teams_per_match - 1)).ceil + 1 @@ -138,5 +130,14 @@ STRING return str end + private + + def tournament_stage + @tournament_stage + end + + def tournament + self.tournament_stage.tournament + end end end |