Class: TeamSeeder
- Inherits:
-
Object
- Object
- TeamSeeder
- Defined in:
- lib/bracket_graph/team_seeder.rb
Instance Attribute Summary collapse
-
#size ⇒ Object
readonly
Returns the value of attribute size.
Instance Method Summary collapse
-
#initialize(teams, size, shuffle: false) ⇒ TeamSeeder
constructor
A new instance of TeamSeeder.
- #slots ⇒ Object
Constructor Details
#initialize(teams, size, shuffle: false) ⇒ TeamSeeder
Returns a new instance of TeamSeeder.
4 5 6 7 |
# File 'lib/bracket_graph/team_seeder.rb', line 4 def initialize teams, size, shuffle: false @teams = shuffle && teams.shuffle || teams.dup @size = size end |
Instance Attribute Details
#size ⇒ Object (readonly)
Returns the value of attribute size.
2 3 4 |
# File 'lib/bracket_graph/team_seeder.rb', line 2 def size @size end |
Instance Method Details
#slots ⇒ Object
9 10 11 12 13 14 15 |
# File 'lib/bracket_graph/team_seeder.rb', line 9 def slots return @slots if @slots @slots = [true] * size seed_byes seed_teams @slots end |