Class: YearMonthCommitStats

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

#initializeYearMonthCommitStats

Returns a new instance of YearMonthCommitStats.



32
33
34
# File 'lib/gitstats/stats/commit/time.rb', line 32

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



36
37
38
39
40
# File 'lib/gitstats/stats/commit/time.rb', line 36

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