Class: Merb::Cache::AdhocStore

Class | Merb::Cache::AdhocStore
In: | lib/merb-cache/stores/strategy/adhoc_store.rb
Parent: | AbstractStrategyStore

General purpose store, use for your own contexts. Since it wraps access to multiple fundamental stores, it‘s easy to use this strategy store with distributed cache stores like Memcached.

### Methods

delete delete_all! exists? fetch new read writable? write write_all

### External Aliases

new | -> | []

### Attributes

stores | [RW] |

### Public Class methods

new(*names)

### Public Instance methods

delete(key, parameters = {})

deletes the entry for the key & parameter from the store.

delete_all!()

deletes all entries for the key & parameters for the store. considered dangerous because strategy stores which call delete_all! on their context stores could delete other store‘s entrees.

exists?(key, parameters = {})

returns true/false/nil based on if data identified by the key & parameters is persisted in the store.

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. If it cannot be fetched, the block call is returned.

read(key, parameters = {})

gets the data from the store identified by the key & parameters. return nil if the entry does not exist.

writable?(key, parameters = {}, conditions = {})
write(key, data = nil, parameters = {}, conditions = {})

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.

write_all(key, data = nil, parameters = {}, conditions = {})

persists the data to all context stores. returns nil if none of the stores were able to persist the data. returns true if at least one write was successful.

[Validate]