Class: MonthCommitStats

Inherits:
Object
  • Object
show all
Includes:
StatsHash
Defined in:
lib/gitstats/stats/commit/time.rb

Instance Method Summary collapse

Methods included from StatsHash

#each_sorted, #method_missing

Constructor Details

#initializeMonthCommitStats

Returns a new instance of MonthCommitStats.



18
19
20
# File 'lib/gitstats/stats/commit/time.rb', line 18

def initialize
  @hash = Hash.new
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class StatsHash

Instance Method Details

#update(commit) ⇒ Object



22
23
24
25
26
# File 'lib/gitstats/stats/commit/time.rb', line 22

def update(commit)
  month = commit[:time].month
  @hash[month] ||= AuthorsCommitStats.new
  @hash[month].update(commit)
end