Class: CumulativeFlow
- Inherits:
-
Object
- Object
- CumulativeFlow
- Defined in:
- lib/cumulative_flow.rb
Instance Method Summary collapse
-
#initialize(user_story_history, states: nil, iteration_start: nil) ⇒ CumulativeFlow
constructor
A new instance of CumulativeFlow.
- #to_csv ⇒ Object
Constructor Details
#initialize(user_story_history, states: nil, iteration_start: nil) ⇒ CumulativeFlow
Returns a new instance of CumulativeFlow.
7 8 9 10 |
# File 'lib/cumulative_flow.rb', line 7 def initialize(user_story_history, states: nil, iteration_start: nil) @data = dates(user_story_history, iteration_start).map {|date| {"Date" => date}.merge(effort_by_state(snapshot(user_story_history, date))) } @states = states || all_states(user_story_history) end |
Instance Method Details
#to_csv ⇒ Object
12 13 14 15 16 17 18 19 |
# File 'lib/cumulative_flow.rb', line 12 def to_csv CSV.generate do |csv| csv << [''] + @states @data.each do |i| csv << [ i["Date"] ] + @states.map {|state| i[state] || 0.0} end end end |