Class: DayOfWeekCommitStats

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

#initializeDayOfWeekCommitStats

Returns a new instance of DayOfWeekCommitStats.



78
79
80
# File 'lib/gitstats/stats/commit/time.rb', line 78

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



82
83
84
85
86
# File 'lib/gitstats/stats/commit/time.rb', line 82

def update(commit)
  day = commit[:time].wday
  @hash[day] ||= HourCommitStats.new
  @hash[day].update(commit)
end