Class: YearMonthCommitStats
- Inherits:
-
Object
- Object
- YearMonthCommitStats
- Includes:
- StatsHash
- Defined in:
- lib/gitstats/stats/commit/time.rb
Instance Method Summary collapse
-
#initialize ⇒ YearMonthCommitStats
constructor
A new instance of YearMonthCommitStats.
- #update(commit) ⇒ Object
Methods included from StatsHash
Constructor Details
#initialize ⇒ YearMonthCommitStats
Returns a new instance of YearMonthCommitStats.
32 33 34 |
# File 'lib/gitstats/stats/commit/time.rb', line 32 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
36 37 38 39 40 |
# File 'lib/gitstats/stats/commit/time.rb', line 36 def update(commit) yearmonth = YearMonth.new(commit[:time]) @hash[yearmonth] ||= AuthorsCommitStats.new @hash[yearmonth].update(commit) end |