Class: Regis::Cache
- Inherits:
-
Object
- Object
- Regis::Cache
- Defined in:
- lib/regis/cache.rb
Instance Attribute Summary collapse
-
#store ⇒ Object
Returns the value of attribute store.
Instance Method Summary collapse
- #delete(key) ⇒ Object
-
#initialize(store) ⇒ Cache
constructor
A new instance of Cache.
- #read(key) ⇒ Object
- #write(key, value) ⇒ Object
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
#store ⇒ Object
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 |