Class: Gracefully::InMemoryCounter

Inherits:
Counter
  • Object
show all
Defined in:
lib/gracefully/counter.rb

Instance Method Summary collapse

Constructor Details

#initializeInMemoryCounter

Returns a new instance of InMemoryCounter.



13
14
15
# File 'lib/gracefully/counter.rb', line 13

def initialize
  @count = 0
end

Instance Method Details

#countObject



25
26
27
# File 'lib/gracefully/counter.rb', line 25

def count
  @count
end

#increment!Object



21
22
23
# File 'lib/gracefully/counter.rb', line 21

def increment!
  @count += 1
end

#reset!Object



17
18
19
# File 'lib/gracefully/counter.rb', line 17

def reset!
  @count = 0
end