delete

delete(name, options = nil) Instance Public methods Deletes an entry in the cache. Returns true if an entry is deleted. Options are passed to the underlying cache implementation.

delete_matched

delete_matched(matcher, options = nil) Instance Public methods Delete all entries with keys matching the pattern. Options are passed to the underlying cache implementation. All implementations may not support this method.

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.

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

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

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.

mute

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

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.

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.

silence!

silence!() Instance Public methods Silence the logger.