From 80dee9c234c80820c7d9e61df9da0c851f83ae79 Mon Sep 17 00:00:00 2001 From: "R.J. Osborne" Date: Mon, 18 May 2015 21:28:04 -0400 Subject: [PATCH] An instance variable doesn't need to be passed around inside the class as an argument --- app/models/pool.rb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/models/pool.rb b/app/models/pool.rb index d21af75..23f6037 100644 --- a/app/models/pool.rb +++ b/app/models/pool.rb @@ -3,14 +3,14 @@ class Pool @pools = weight.pools @pool = 1 while @pool <= @pools - matches = roundRobin(@pool, weight.wrestlers, weight, tournament , matches) + matches = roundRobin(weight.wrestlers, weight, tournament , matches) @pool += 1 end return matches end - def roundRobin(pool,wrestlers,weight,tournament,matches) - @wrestlers = wrestlers.select{|w| w.generatePoolNumber == pool}.to_a + def roundRobin(wrestlers,weight,tournament,matches) + @wrestlers = wrestlers.select{|w| w.generatePoolNumber == @pool}.to_a @poolMatches = RoundRobinTournament.schedule(@wrestlers).reverse @poolMatches.each_with_index do |b,index| @bout = b.map