Class: BracketGraph::LoserGraph
- Defined in:
- lib/bracket_graph/loser_graph.rb
Defined Under Namespace
Classes: IdGenerator
Instance Attribute Summary
Attributes inherited from Graph
#root, #seats, #starting_seats
Instance Method Summary collapse
-
#initialize(root_or_size) ⇒ LoserGraph
constructor
A new instance of LoserGraph.
- #size ⇒ Object
Methods inherited from Graph
Constructor Details
#initialize(root_or_size) ⇒ LoserGraph
Returns a new instance of LoserGraph.
17 18 19 20 |
# File 'lib/bracket_graph/loser_graph.rb', line 17 def initialize root_or_size raise ArgumentError, 'a loser graph require at least 4 participants' if root_or_size.is_a?(Fixnum) && root_or_size < 4 super end |
Instance Method Details
#size ⇒ Object
22 23 24 |
# File 'lib/bracket_graph/loser_graph.rb', line 22 def size starting_seats.count + 1 end |