Class: YearCommitStats

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

#initializeYearCommitStats

Returns a new instance of YearCommitStats.



4
5
6
# File 'lib/gitstats/stats/commit/time.rb', line 4

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



8
9
10
11
12
# File 'lib/gitstats/stats/commit/time.rb', line 8

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