Class: Tournament::ScoringStrategy::ConstantValue

Inherits:
Object
  • Object
show all
Defined in:
lib/tournament/scoring_strategy.rb

Overview

Class representing a scoring strategy where correct picks are worth 1 point each, regardless of round

Instance Method Summary collapse

Instance Method Details

#descriptionObject



44
45
46
# File 'lib/tournament/scoring_strategy.rb', line 44

def description
  "Each correct pick is worth 1 point, regardless of the round."
end

#nameObject



41
42
43
# File 'lib/tournament/scoring_strategy.rb', line 41

def name
  'Constant Value'
end

#score(pick, winner, loser, round) ⇒ Object



38
39
40
# File 'lib/tournament/scoring_strategy.rb', line 38

def score(pick, winner, loser, round)
  winner != Tournament::Bracket::UNKNOWN_TEAM && pick == winner ? 1 : 0
end