Actually make singleton_methods private

(Rubocop told me so and I trust the police)
This commit is contained in:
Daniel Schädler 2019-05-13 13:57:23 +02:00
parent e0ef39cc4b
commit 95bed3959f
1 changed files with 32 additions and 30 deletions

View File

@ -101,14 +101,15 @@ class PlayoffStageService
match_below
end
class << self
private
def self.find_companion_match(current_position, current_stage)
def find_companion_match(current_position, current_stage)
companion_match_position = current_position.even? ? current_position + 1 : current_position - 1
current_stage.matches.find { |m| m.position == companion_match_position }
end
def self.assign_correct_match_scores!(match_scores, winners)
def assign_correct_match_scores!(match_scores, winners)
case match_scores.size
when 0
# when 0 match_scores are already there we create both of them with the respective winner from above
@ -131,8 +132,9 @@ class PlayoffStageService
match_scores
end
def self.get_winners_of(companion_match, current_match)
def get_winners_of(companion_match, current_match)
matches = [current_match, companion_match].sort_by(&:position)
matches.map(&:winner)
end
end
end