Class: FancyCount::Counter
- Inherits:
-
Object
- Object
- FancyCount::Counter
- Defined in:
- lib/fancy_count/counter.rb
Instance Method Summary collapse
- #change(value) ⇒ Object
- #decrement ⇒ Object
- #delete ⇒ Object
- #increment ⇒ Object
-
#initialize(name, config = nil) ⇒ Counter
constructor
A new instance of Counter.
- #reset ⇒ Object
- #value ⇒ Object
Constructor Details
#initialize(name, config = nil) ⇒ Counter
Returns a new instance of Counter.
5 6 7 8 |
# File 'lib/fancy_count/counter.rb', line 5 def initialize(name, config = nil) @name = name @config = config || ::FancyCount.config end |
Instance Method Details
#change(value) ⇒ Object
18 19 20 |
# File 'lib/fancy_count/counter.rb', line 18 def change(value) adapter.change(value) end |
#decrement ⇒ Object
14 15 16 |
# File 'lib/fancy_count/counter.rb', line 14 def decrement adapter.decrement end |
#delete ⇒ Object
30 31 32 |
# File 'lib/fancy_count/counter.rb', line 30 def delete adapter.delete end |
#increment ⇒ Object
10 11 12 |
# File 'lib/fancy_count/counter.rb', line 10 def increment adapter.increment end |
#reset ⇒ Object
22 23 24 |
# File 'lib/fancy_count/counter.rb', line 22 def reset adapter.reset end |
#value ⇒ Object
26 27 28 |
# File 'lib/fancy_count/counter.rb', line 26 def value adapter.value end |