Class: HourCommitStats

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

Instance Attribute Summary

Attributes inherited from CommitStats

#commits, #files, #files_added, #files_deleted, #first_commit, #last_commit, #lines, #lines_added, #lines_deleted

Instance Method Summary collapse

Methods included from StatsHash

#each_sorted, #method_missing

Methods inherited from CommitStats

#days

Constructor Details

#initializeHourCommitStats



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

def initialize
  super
  @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



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

def update(commit)
  super(commit)

  hour = commit[:time].hour
  @hash[hour] ||= CommitStats.new
  @hash[hour].update(commit)
end