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.
6 7 8 |
# File 'lib/cache_store.rb', line 6 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.
38 39 40 |
# File 'lib/cache_store.rb', line 38 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.
24 25 26 |
# File 'lib/cache_store.rb', line 24 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.
31 32 33 |
# File 'lib/cache_store.rb', line 31 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.
15 16 17 |
# File 'lib/cache_store.rb', line 15 def set(key, value, expires_in = 0) end |