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