Class: YearCommitStats
- Inherits:
-
Object
- Object
- YearCommitStats
- Includes:
- StatsHash
- Defined in:
- lib/gitstats/stats/commit/time.rb
Instance Method Summary collapse
-
#initialize ⇒ YearCommitStats
constructor
A new instance of YearCommitStats.
- #update(commit) ⇒ Object
Methods included from StatsHash
Constructor Details
#initialize ⇒ YearCommitStats
Returns a new instance of YearCommitStats.
4 5 6 |
# File 'lib/gitstats/stats/commit/time.rb', line 4 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
8 9 10 11 12 |
# File 'lib/gitstats/stats/commit/time.rb', line 8 def update(commit) year = commit[:time].year @hash[year] ||= AuthorsCommitStats.new @hash[year].update(commit) end |