Class: Merb::Cache::AbstractStore
- Inherits:
-
Object
- Object
- Merb::Cache::AbstractStore
- Defined in:
- lib/merb-cache/stores/fundamental/abstract_store.rb
Direct Known Subclasses
Instance Method Summary collapse
-
#delete(key, parameters = {}) ⇒ Object
deletes the entry for the key & parameter from the store.
-
#delete_all ⇒ TrueClass
deletes all entries for the key & parameters for the store.
-
#delete_all! ⇒ TrueClass
dangerous version of delete_all.
-
#exists?(key, parameters = {}) ⇒ TrueClass
returns true/false/nil based on if data identified by the key & parameters is persisted in the store.
-
#fetch(key, parameters = {}, conditions = {}, &blk) ⇒ Object, NilClass
tries to read the data from the store.
-
#initialize(config = {}) ⇒ AbstractStore
constructor
A new instance of AbstractStore.
-
#read(key, parameters = {}) ⇒ Object, NilClass
gets the data from the store identified by the key & parameters.
-
#writable?(key, parameters = {}, conditions = {}) ⇒ TrueClass
determines if the store is able to persist data identified by the key & parameters with the given conditions.
-
#write(key, data = nil, parameters = {}, conditions = {}) ⇒ TrueClass, NilClass
persists the data so that it can be retrieved by the key & parameters.
-
#write_all(key, data = nil, parameters = {}, conditions = {}) ⇒ TrueClass, NilClass
True if the entry was successfully written, otherwise nil.
Constructor Details
#initialize(config = {}) ⇒ AbstractStore
Returns a new instance of AbstractStore.
3 |
# File 'lib/merb-cache/stores/fundamental/abstract_store.rb', line 3 def initialize(config = {}); end |
Instance Method Details
#delete(key, parameters = {}) ⇒ Object
deletes the entry for the key & parameter from the store.
81 82 83 |
# File 'lib/merb-cache/stores/fundamental/abstract_store.rb', line 81 def delete(key, parameters = {}) raise NotImplementedError end |
#delete_all ⇒ TrueClass
deletes all entries for the key & parameters for the store.
89 90 91 |
# File 'lib/merb-cache/stores/fundamental/abstract_store.rb', line 89 def delete_all raise NotImplementedError end |
#delete_all! ⇒ TrueClass
dangerous version of delete_all. Used by strategy stores, which may delete entries not associated with the strategy store making the call.
98 99 100 |
# File 'lib/merb-cache/stores/fundamental/abstract_store.rb', line 98 def delete_all! delete_all end |
#exists?(key, parameters = {}) ⇒ TrueClass
returns true/false/nil based on if data identified by the key & parameters is persisted in the store.
71 72 73 |
# File 'lib/merb-cache/stores/fundamental/abstract_store.rb', line 71 def exists?(key, parameters = {}) raise NotImplementedError end |
#fetch(key, parameters = {}, conditions = {}, &blk) ⇒ Object, NilClass
tries to read the data from the store. If that fails, it calls the block parameter and persists the result.
60 61 62 |
# File 'lib/merb-cache/stores/fundamental/abstract_store.rb', line 60 def fetch(key, parameters = {}, conditions = {}, &blk) raise NotImplementedError end |
#read(key, parameters = {}) ⇒ Object, NilClass
gets the data from the store identified by the key & parameters. return nil if the entry does not exist.
24 25 26 |
# File 'lib/merb-cache/stores/fundamental/abstract_store.rb', line 24 def read(key, parameters = {}) raise NotImplementedError end |
#writable?(key, parameters = {}, conditions = {}) ⇒ TrueClass
determines if the store is able to persist data identified by the key & parameters with the given conditions.
13 14 15 |
# File 'lib/merb-cache/stores/fundamental/abstract_store.rb', line 13 def writable?(key, parameters = {}, conditions = {}) raise NotImplementedError end |
#write(key, data = nil, parameters = {}, conditions = {}) ⇒ TrueClass, NilClass
persists the data so that it can be retrieved by the key & parameters. returns nil if it is unable to persist the data. returns true if successful.
38 39 40 |
# File 'lib/merb-cache/stores/fundamental/abstract_store.rb', line 38 def write(key, data = nil, parameters = {}, conditions = {}) raise NotImplementedError end |
#write_all(key, data = nil, parameters = {}, conditions = {}) ⇒ TrueClass, NilClass
Returns true if the entry was successfully written, otherwise nil.
48 49 50 |
# File 'lib/merb-cache/stores/fundamental/abstract_store.rb', line 48 def write_all(key, data = nil, parameters = {}, conditions = {}) write(key, data, parameters, conditions) end |