From 9d0be853cef35412c0bfe92c80502fd9da7947f1 Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Sun, 27 Apr 2014 20:29:22 -0400 Subject: Fix namespacing in lib/seeding --- lib/seeding/early_bird_seeding.rb | 6 +++--- lib/seeding/fair_ranked_seeding.rb | 16 ++++++++-------- lib/seeding/random_seeding.rb | 6 +++--- 3 files changed, 14 insertions(+), 14 deletions(-) diff --git a/lib/seeding/early_bird_seeding.rb b/lib/seeding/early_bird_seeding.rb index f3fc6f9..488a1a2 100644 --- a/lib/seeding/early_bird_seeding.rb +++ b/lib/seeding/early_bird_seeding.rb @@ -1,6 +1,6 @@ module Seeding - class EarlyBirdSeeding - def seed(tournament_stage) + module EarlyBirdSeeding + def self.seed(tournament_stage) matches = tournament.current_stage.matches match = matches.first match_num = 0 @@ -17,4 +17,4 @@ module Seeding end end end -end \ No newline at end of file +end diff --git a/lib/seeding/fair_ranked_seeding.rb b/lib/seeding/fair_ranked_seeding.rb index 22c245e..f56d648 100644 --- a/lib/seeding/fair_ranked_seeding.rb +++ b/lib/seeding/fair_ranked_seeding.rb @@ -1,6 +1,6 @@ module Seeding - class FairRankedSeeding - def seed(tournament_stage) + module FairRankedSeeding + def self.seed(tournament_stage) matches = tournament.current_stage.matches match = matches.first match_num = 0 @@ -19,17 +19,17 @@ module Seeding end private - def best_first(tournament) + def self.best_first(tournament) tournament.players.sort {|a, b| better(a, b, tournament) } end - def better(player1, player2, tournament) - ps1 = previousScore(player1, tournament) - ps2 = previousScore(player2, tournament) + def self.better(player1, player2, tournament) + ps1 = previous_score(player1, tournament) + ps2 = previous_score(player2, tournament) ps1 <=> ps2 end - def previousScore(player, tournament) + def self.previous_score(player, tournament) score = tournament.statistics.getStatistic(player.matches.last, player, :score) if score.nil? return 0 @@ -37,4 +37,4 @@ module Seeding score end end -end \ No newline at end of file +end diff --git a/lib/seeding/random_seeding.rb b/lib/seeding/random_seeding.rb index bc332ef..723d70e 100644 --- a/lib/seeding/random_seeding.rb +++ b/lib/seeding/random_seeding.rb @@ -1,6 +1,6 @@ module Seeding - class RandomSeeding - def seed(tournament_stage) + module RandomSeeding + def self.seed(tournament_stage) matches = tournament.current_stage.matches match = matches.first match_num = 0 @@ -17,4 +17,4 @@ module Seeding end end end -end \ No newline at end of file +end -- cgit v1.2.3