Class: Brackets::Tournament
- Inherits:
-
Object
- Object
- Brackets::Tournament
- Defined in:
- lib/brackets/tournament.rb
Instance Method Summary collapse
- #generate(competitors) ⇒ Object
-
#initialize(counter = Brackets::Util::BooleanCounter.new) ⇒ Tournament
constructor
A new instance of Tournament.
Constructor Details
#initialize(counter = Brackets::Util::BooleanCounter.new) ⇒ Tournament
Returns a new instance of Tournament.
3 4 5 |
# File 'lib/brackets/tournament.rb', line 3 def initialize(counter = Brackets::Util::BooleanCounter.new) @counter = counter end |
Instance Method Details
#generate(competitors) ⇒ Object
7 8 9 10 11 |
# File 'lib/brackets/tournament.rb', line 7 def generate(competitors) return [] if competitors.to_a.empty? generate_rounds(generate_first_round(competitors)) end |