Class: FileStats
- Inherits:
-
Object
- Object
- FileStats
- Defined in:
- lib/gitstats/stats/file.rb
Instance Attribute Summary collapse
-
#count ⇒ Object
readonly
Returns the value of attribute count.
-
#size ⇒ Object
readonly
Returns the value of attribute size.
Instance Method Summary collapse
-
#initialize ⇒ FileStats
constructor
A new instance of FileStats.
- #update(file) ⇒ Object
Constructor Details
#initialize ⇒ FileStats
Returns a new instance of FileStats.
5 6 7 8 |
# File 'lib/gitstats/stats/file.rb', line 5 def initialize @count = 0 @size = 0 end |
Instance Attribute Details
#count ⇒ Object (readonly)
Returns the value of attribute count.
2 3 4 |
# File 'lib/gitstats/stats/file.rb', line 2 def count @count end |
#size ⇒ Object (readonly)
Returns the value of attribute size.
3 4 5 |
# File 'lib/gitstats/stats/file.rb', line 3 def size @size end |
Instance Method Details
#update(file) ⇒ Object
10 11 12 13 |
# File 'lib/gitstats/stats/file.rb', line 10 def update(file) @count += 1 @size += file[:size] end |