Class: BracketGraph::LoserGraph::IdGenerator
- Inherits:
-
Object
- Object
- BracketGraph::LoserGraph::IdGenerator
- Defined in:
- lib/bracket_graph/loser_graph.rb
Instance Attribute Summary collapse
-
#current ⇒ Object
readonly
Returns the value of attribute current.
Instance Method Summary collapse
-
#initialize(starting_id = 0) ⇒ IdGenerator
constructor
A new instance of IdGenerator.
- #next ⇒ Object
Constructor Details
#initialize(starting_id = 0) ⇒ IdGenerator
Returns a new instance of IdGenerator.
8 9 10 |
# File 'lib/bracket_graph/loser_graph.rb', line 8 def initialize starting_id = 0 @current = starting_id end |
Instance Attribute Details
#current ⇒ Object (readonly)
Returns the value of attribute current.
6 7 8 |
# File 'lib/bracket_graph/loser_graph.rb', line 6 def current @current end |
Instance Method Details
#next ⇒ Object
12 13 14 |
# File 'lib/bracket_graph/loser_graph.rb', line 12 def next @current += 1 end |