Class: Artisan::Projects::StoryPointSummer

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

Instance Method Summary collapse

Constructor Details

#initialize(stories) ⇒ StoryPointSummer

Returns a new instance of StoryPointSummer.



6
7
8
# File 'lib/artisan/projects/story_point_summer.rb', line 6

def initialize(stories)
  @stories = stories
end

Instance Method Details

#sumObject



10
11
12
13
# File 'lib/artisan/projects/story_point_summer.rb', line 10

def sum
  total = @stories.inject(0){ |total, story| total + story.estimate }
  return total.round(2)
end