Class: Merb::Cache::AbstractStore Abstract
- Inherits:
-
Object
- Object
- Merb::Cache::AbstractStore
- Defined in:
- merb-cache/lib/merb-cache/stores/fundamental/abstract_store.rb
Overview
Subclass and override all methods.
Direct Known Subclasses
Instance Method Summary (collapse)
-
- (Object) delete(key, parameters = {})
Deletes the entry for the key & parameter from the store.
-
- (Boolean) delete_all
deletes all entries for the key & parameters for the store.
-
- (Boolean) delete_all!
Dangerous version of delete_all.
-
- (Boolean) exists?(key, parameters = {})
Returns true/false/nil based on if data identified by the key & parameters is persisted in the store.
-
- (Object, NilClass) fetch(key, parameters = {}, conditions = {}, &blk)
Tries to read the data from the store.
-
- (AbstractStore) initialize(config = {})
constructor
A new instance of AbstractStore.
-
- (Object, NilClass) read(key, parameters = {})
Gets the data from the store identified by the key & parameters.
-
- (TrueClass) writable?(key, parameters = {}, conditions = {})
Determines if the store is able to persist data identified by the key & parameters with the given conditions.
-
- (TrueClass, NilClass) write(key, data = nil, parameters = {}, conditions = {})
Persists the data so that it can be retrieved by the key & parameters.
-
- (TrueClass, NilClass) write_all(key, data = nil, parameters = {}, conditions = {})
True if the entry was successfully written, otherwise nil.
Constructor Details
- (AbstractStore) initialize(config = {})
A new instance of AbstractStore
4 |
# File 'merb-cache/lib/merb-cache/stores/fundamental/abstract_store.rb', line 4 def initialize(config = {}); end |
Instance Method Details
- (Object) delete(key, parameters = {})
Deletes the entry for the key & parameter from the store.
79 80 81 |
# File 'merb-cache/lib/merb-cache/stores/fundamental/abstract_store.rb', line 79 def delete(key, parameters = {}) raise NotImplementedError end |
- (Boolean) delete_all
deletes all entries for the key & parameters for the store.
87 88 89 |
# File 'merb-cache/lib/merb-cache/stores/fundamental/abstract_store.rb', line 87 def delete_all raise NotImplementedError end |
- (Boolean) delete_all!
Dangerous version of delete_all. Used by strategy stores, which may delete entries not associated with the strategy store making the call.
97 98 99 |
# File 'merb-cache/lib/merb-cache/stores/fundamental/abstract_store.rb', line 97 def delete_all! delete_all end |
- (Boolean) exists?(key, parameters = {})
Returns true/false/nil based on if data identified by the key & parameters is persisted in the store.
69 70 71 |
# File 'merb-cache/lib/merb-cache/stores/fundamental/abstract_store.rb', line 69 def exists?(key, parameters = {}) raise NotImplementedError end |
- (Object, NilClass) fetch(key, parameters = {}, conditions = {}, &blk)
Tries to read the data from the store. If that fails, it calls the block parameter and persists the result.
58 59 60 |
# File 'merb-cache/lib/merb-cache/stores/fundamental/abstract_store.rb', line 58 def fetch(key, parameters = {}, conditions = {}, &blk) raise NotImplementedError end |
- (Object, NilClass) read(key, parameters = {})
Gets the data from the store identified by the key & parameters.
24 25 26 |
# File 'merb-cache/lib/merb-cache/stores/fundamental/abstract_store.rb', line 24 def read(key, parameters = {}) raise NotImplementedError end |
- (TrueClass) writable?(key, parameters = {}, conditions = {})
Determines if the store is able to persist data identified by the key & parameters with the given conditions.
14 15 16 |
# File 'merb-cache/lib/merb-cache/stores/fundamental/abstract_store.rb', line 14 def writable?(key, parameters = {}, conditions = {}) raise NotImplementedError end |
- (TrueClass, NilClass) write(key, data = nil, parameters = {}, conditions = {})
Persists the data so that it can be retrieved by the key & parameters.
36 37 38 |
# File 'merb-cache/lib/merb-cache/stores/fundamental/abstract_store.rb', line 36 def write(key, data = nil, parameters = {}, conditions = {}) raise NotImplementedError end |
- (TrueClass, NilClass) write_all(key, data = nil, parameters = {}, conditions = {})
True if the entry was successfully written, otherwise nil
46 47 48 |
# File 'merb-cache/lib/merb-cache/stores/fundamental/abstract_store.rb', line 46 def write_all(key, data = nil, parameters = {}, conditions = {}) write(key, data, parameters, conditions) end |