Class: Artisan::Projects::IterationNumberer
- Inherits:
-
Object
- Object
- Artisan::Projects::IterationNumberer
- Defined in:
- lib/artisan/projects/iteration_numberer.rb
Instance Method Summary collapse
-
#initialize(project) ⇒ IterationNumberer
constructor
A new instance of IterationNumberer.
- #next_iteration_number ⇒ Object
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_number ⇒ Object
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 |