key_matcher

key_matcher(pattern, options) Instance Protected methods Add the namespace defined in the options to a pattern designed to match keys. Implementations that support #delete_matched should call this method to translate a pattern that matches names into one that matches namespaced keys.

write

write(name, value, options = nil) Instance Public methods Writes the value to the cache, with the key. Options are passed to the underlying cache implementation.

silence!

silence!() Instance Public methods Silence the logger.

read_multi

read_multi(*names) Instance Public methods Read multiple values at once from the cache. Options can be passed in the last argument. Some cache implementation may optimize this method. Returns a hash mapping the names provided to the values found.

read

read(name, options = nil) Instance Public methods Fetches data from the cache, using the given key. If there is data in the cache with the given key, then that data is returned. Otherwise, nil is returned. Options are passed to the underlying cache implementation.

mute

mute() Instance Public methods Silence the logger within a block.

increment

increment(name, amount = 1, options = nil) Instance Public methods Increment an integer value in the cache. Options are passed to the underlying cache implementation. All implementations may not support this method.

fetch_multi

fetch_multi(*names) Instance Public methods Fetches data from the cache, using the given keys. If there is data in the cache with the given keys, then that data is returned. Otherwise, the supplied block is called for each key for which there was no data, and the result will be written to the cache and returned. Options are passed to the underlying cache implementation. Returns an array with the data for each of the names. For example: cache.write("bim", "bam") cache.fetch_multi("b

fetch

fetch(name, options = nil) Instance Public methods Fetches data from the cache, using the given key. If there is data in the cache with the given key, then that data is returned. If there is no such data in the cache (a cache miss), then nil will be returned. However, if a block has been passed, that block will be passed the key and executed in the event of a cache miss. The return value of the block will be written to the cache under the given cache key, and that return value will

exist?

exist?(name, options = nil) Instance Public methods Returns true if the cache contains an entry for the given key. Options are passed to the underlying cache implementation.