Class: Regis::Cache

Inherits:
Object
  • Object
show all
Defined in:
lib/regis/cache.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(store) ⇒ Cache

Returns a new instance of Cache.



5
6
7
# File 'lib/regis/cache.rb', line 5

def initialize(store)
    @store = store
end

Instance Attribute Details

#storeObject

Returns the value of attribute store.



3
4
5
# File 'lib/regis/cache.rb', line 3

def store
  @store
end

Instance Method Details

#delete(key) ⇒ Object



17
18
19
# File 'lib/regis/cache.rb', line 17

def delete(key)
    @store.delete(key)
end

#read(key) ⇒ Object



13
14
15
# File 'lib/regis/cache.rb', line 13

def read(key)
    @store.get(key)
end

#write(key, value) ⇒ Object



9
10
11
# File 'lib/regis/cache.rb', line 9

def write(key, value)
    @store.set(key, value)
end