Class: FancyCount::Counter

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

Instance Method Summary collapse

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

#decrementObject



14
15
16
# File 'lib/fancy_count/counter.rb', line 14

def decrement
  adapter.decrement
end

#deleteObject



30
31
32
# File 'lib/fancy_count/counter.rb', line 30

def delete
  adapter.delete
end

#incrementObject



10
11
12
# File 'lib/fancy_count/counter.rb', line 10

def increment
  adapter.increment
end

#resetObject



22
23
24
# File 'lib/fancy_count/counter.rb', line 22

def reset
  adapter.reset
end

#valueObject



26
27
28
# File 'lib/fancy_count/counter.rb', line 26

def value
  adapter.value
end