Class: DateCommitStats
- Inherits:
-
Object
- Object
- DateCommitStats
- Includes:
- StatsHash
- Defined in:
- lib/gitstats/stats/commit/time.rb
Instance Method Summary collapse
-
#initialize ⇒ DateCommitStats
constructor
A new instance of DateCommitStats.
- #update(commit) ⇒ Object
Methods included from StatsHash
Constructor Details
#initialize ⇒ DateCommitStats
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 |