Class: DateCommitStats

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

#initializeDateCommitStats

Returns a new instance of DateCommitStats.



46
47
48
# File 'lib/gitstats/stats/commit/time.rb', line 46

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



50
51
52
53
54
55
# File 'lib/gitstats/stats/commit/time.rb', line 50

def update(commit)
  t = commit[:time]
  date = Date.civil(t.year, t.month, t.day)
  @hash[date] ||= AuthorsCommitStats.new
  @hash[date].update(commit)
end