Class: FileStats

Inherits:
Object
  • Object
show all
Defined in:
lib/gitstats/stats/file.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeFileStats

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

#countObject (readonly)

Returns the value of attribute count.



2
3
4
# File 'lib/gitstats/stats/file.rb', line 2

def count
  @count
end

#sizeObject (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