Class: HourCommitStats
- Inherits:
-
CommitStats
- Object
- CommitAccumulator
- CommitStats
- HourCommitStats
- Includes:
- StatsHash
- Defined in:
- lib/gitstats/stats/commit/time.rb
Instance Attribute Summary
Attributes inherited from CommitAccumulator
#commits, #files_added, #files_deleted, #first_commit, #last_commit, #lines_added, #lines_deleted
Instance Method Summary collapse
-
#initialize ⇒ HourCommitStats
constructor
A new instance of HourCommitStats.
- #update(commit) ⇒ Object
Methods included from StatsHash
Methods inherited from CommitStats
Methods inherited from CommitAccumulator
Constructor Details
#initialize ⇒ HourCommitStats
Returns a new instance of HourCommitStats.
61 62 63 64 |
# File 'lib/gitstats/stats/commit/time.rb', line 61 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
66 67 68 69 70 71 72 |
# File 'lib/gitstats/stats/commit/time.rb', line 66 def update(commit) super(commit) hour = commit[:time].hour @hash[hour] ||= CommitStats.new @hash[hour].update(commit) end |