Class: BracketGraph::LoserGraph::IdGenerator

Inherits:
Object
  • Object
show all
Defined in:
lib/bracket_graph/loser_graph.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#currentObject (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

#nextObject



12
13
14
# File 'lib/bracket_graph/loser_graph.rb', line 12

def next
  @current += 1
end