Class: Reports::VelocityReport
- Inherits:
-
Object
- Object
- Reports::VelocityReport
- Defined in:
- lib/artisan/reports/velocity_report.rb
Instance Attribute Summary collapse
-
#limit ⇒ Object
Returns the value of attribute limit.
-
#project ⇒ Object
Returns the value of attribute project.
-
#results ⇒ Object
Returns the value of attribute results.
Instance Method Summary collapse
- #collect_dates ⇒ Object
- #collect_iteration(action) ⇒ Object
- #completed_points ⇒ Object
- #generate(criteria = {}) ⇒ Object
-
#initialize(project) ⇒ VelocityReport
constructor
A new instance of VelocityReport.
- #max_value ⇒ Object
Constructor Details
#initialize(project) ⇒ VelocityReport
Returns a new instance of VelocityReport.
6 7 8 |
# File 'lib/artisan/reports/velocity_report.rb', line 6 def initialize(project) @project = project end |
Instance Attribute Details
#limit ⇒ Object
Returns the value of attribute limit.
4 5 6 |
# File 'lib/artisan/reports/velocity_report.rb', line 4 def limit @limit end |
#project ⇒ Object
Returns the value of attribute project.
4 5 6 |
# File 'lib/artisan/reports/velocity_report.rb', line 4 def project @project end |
#results ⇒ Object
Returns the value of attribute results.
4 5 6 |
# File 'lib/artisan/reports/velocity_report.rb', line 4 def results @results end |
Instance Method Details
#collect_dates ⇒ Object
24 25 26 |
# File 'lib/artisan/reports/velocity_report.rb', line 24 def collect_dates return @results.collect{|iteration| iteration.finish_date.strftime('%b %d')}.reverse end |
#collect_iteration(action) ⇒ Object
15 16 17 |
# File 'lib/artisan/reports/velocity_report.rb', line 15 def collect_iteration(action) return @results.collect {|iteration| iteration.send(action.to_sym) }.reverse end |
#completed_points ⇒ Object
28 29 30 |
# File 'lib/artisan/reports/velocity_report.rb', line 28 def completed_points return @results.collect {|iteration| Artisan::Iterations::IterationPointCalculator.new(iteration).completed_points }.reverse end |
#generate(criteria = {}) ⇒ Object
10 11 12 13 |
# File 'lib/artisan/reports/velocity_report.rb', line 10 def generate(criteria = {}) @limit = !criteria[:limit].nil? ? criteria[:limit] : @project.iterations.count @results = limited_iterations_by_finish_date end |
#max_value ⇒ Object
19 20 21 22 |
# File 'lib/artisan/reports/velocity_report.rb', line 19 def max_value list = array_to_f(collect_iteration(:committed_points)).concat(completed_points) return list.sort[-1] end |