Class: CacheStoreContract
- Inherits:
-
Object
- Object
- CacheStoreContract
- Defined in:
- lib/cache_store.rb
Overview
This class is used to define the contract that CacheStore implementations must adhere to.
Instance Method Summary collapse
-
#exist?(key) ⇒ Boolean
This method is called to check if a value exists within this cache store for a specific key.
-
#get(key, expires_in = 0, &block) ⇒ Object
This method is called to get a value from this cache store by it’s unique key.
-
#initialize(namespace = '') ⇒ CacheStoreContract
constructor
A new instance of CacheStoreContract.
-
#remove(key) ⇒ Object
This method is called to remove a value from this cache store by it’s unique key.
-
#set(key, value, expires_in = 0) ⇒ Object
This method is called to set a value within this cache store by it’s key.
Constructor Details
#initialize(namespace = '') ⇒ CacheStoreContract
Returns a new instance of CacheStoreContract.
7 8 9 |
# File 'lib/cache_store.rb', line 7 def initialize(namespace = '') @namespace = namespace end |
Instance Method Details
#exist?(key) ⇒ Boolean
This method is called to check if a value exists within this cache store for a specific key.
39 40 41 |
# File 'lib/cache_store.rb', line 39 def exist?(key) end |
#get(key, expires_in = 0, &block) ⇒ Object
This method is called to get a value from this cache store by it’s unique key.
25 26 27 |
# File 'lib/cache_store.rb', line 25 def get(key, expires_in = 0, &block) end |
#remove(key) ⇒ Object
This method is called to remove a value from this cache store by it’s unique key.
32 33 34 |
# File 'lib/cache_store.rb', line 32 def remove(key) end |
#set(key, value, expires_in = 0) ⇒ Object
This method is called to set a value within this cache store by it’s key.
16 17 18 |
# File 'lib/cache_store.rb', line 16 def set(key, value, expires_in = 0) end |