Class: Reports::VelocityReport

Inherits:
Object
  • Object
show all
Defined in:
lib/artisan/reports/velocity_report.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#limitObject

Returns the value of attribute limit.



4
5
6
# File 'lib/artisan/reports/velocity_report.rb', line 4

def limit
  @limit
end

#projectObject

Returns the value of attribute project.



4
5
6
# File 'lib/artisan/reports/velocity_report.rb', line 4

def project
  @project
end

#resultsObject

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_datesObject



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_pointsObject



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_valueObject



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