Class: Artisan::Projects::IterationNumberer

Inherits:
Object
  • Object
show all
Defined in:
lib/artisan/projects/iteration_numberer.rb

Instance Method Summary collapse

Constructor Details

#initialize(project) ⇒ IterationNumberer

Returns a new instance of IterationNumberer.



4
5
6
# File 'lib/artisan/projects/iteration_numberer.rb', line 4

def initialize(project)
  @project = project
end

Instance Method Details

#next_iteration_numberObject



8
9
10
11
12
# File 'lib/artisan/projects/iteration_numberer.rb', line 8

def next_iteration_number
  max = 0
  @project.iterations.each {|iteration| max = iteration.number if iteration.number > max }
  return max + 1
end