Constructor Details

Creates a new CouchbaseStore object, with the given options. For more info
see ActiveSupport::Cache::CouchbaseStore.{Couchbase{Couchbase::Bucket{Couchbase::Bucket#initialize}

ActiveSupport::Cache::CouchbaseStore.new(:bucket => "cache")

If no options are specified, then CouchbaseStore will connect to localhost
port 8091 (default Couchbase Server port) and will use bucket named
"default" which is always open for unauthorized access (if
exists).

- (Object) fetch(name, options = nil)

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
run 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
be returned.

Parameters:

name(String)
—

name for the key

options(Hash)(defaults to: nil)

Options Hash (options):

:force(true, false)
—

if this option is true it will force cache miss.

:expires_in(Fixnum)
—

the expiration time on the cache in seconds. Values larger than 30*24*60*60
seconds (30 days) are interpreted as absolute times (from the epoch).

:unless_exists(true, false)
—

if this option is true it will write value only if the key
doesn’t exist in the database (it accepts :unless_exist too).