Class: Gracefully::InMemoryCounter
- Defined in:
- lib/gracefully/counter.rb
Instance Method Summary collapse
- #count ⇒ Object
- #increment! ⇒ Object
-
#initialize ⇒ InMemoryCounter
constructor
A new instance of InMemoryCounter.
- #reset! ⇒ Object
Constructor Details
#initialize ⇒ InMemoryCounter
Returns a new instance of InMemoryCounter.
13 14 15 |
# File 'lib/gracefully/counter.rb', line 13 def initialize @count = 0 end |
Instance Method Details
#count ⇒ Object
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 |