Class: Ci::Charts::YearChart

Inherits:
Chart
  • Object
show all
Defined in:
lib/ci/charts.rb

Instance Attribute Summary

Attributes inherited from Chart

#build_times, #labels, #project, #success, #total

Instance Method Summary collapse

Methods inherited from Chart

#initialize, #push

Constructor Details

This class inherits a constructor from Ci::Charts::Chart

Instance Method Details

#collectObject


29
30
31
32
33
34
35
36
# File 'lib/ci/charts.rb', line 29

def collect
  13.times do |i|
    start_month = (Date.today.years_ago(1) + i.month).beginning_of_month
    end_month = start_month.end_of_month

    push(start_month, end_month, "%d %B %Y")
  end
end