Class: FancyCount::Adapter

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

Direct Known Subclasses

RedisAdapter, TestAdapter

Instance Method Summary collapse

Constructor Details

#initialize(name, config) ⇒ Adapter

Returns a new instance of Adapter.



5
6
7
8
# File 'lib/fancy_count/adapter.rb', line 5

def initialize(name, config)
  @name = name
  @config = config
end

Instance Method Details

#change(value) ⇒ Object



18
19
20
# File 'lib/fancy_count/adapter.rb', line 18

def change(value)
  counter.value = value
end

#decrementObject



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

def decrement
  counter.decrement
end

#deleteObject



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

def delete
  counter.delete
end

#incrementObject



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

def increment
  counter.increment
end

#resetObject



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

def reset
  counter.value = 0
end

#valueObject



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

def value
  counter.value
end