Class: ActiveSupport::Cache::CouchbaseStoreWithSaneTtl

Inherits:
CouchbaseStore
  • Object
show all
Includes:
ActiveSupport::Cache::Concerns::SaneMemcachedTtlHelper
Defined in:
lib/active_support/cache/couchbase_store_with_sane_ttl.rb

Constant Summary

Constants included from SaneMemcachedTtl::Utils

SaneMemcachedTtl::Utils::MEMCACHED_MAX_TTL

Instance Method Summary collapse

Methods included from ActiveSupport::Cache::Concerns::SaneMemcachedTtlHelper

#extract_large_default_ttl!, #sanitize_ttl_options!

Methods included from SaneMemcachedTtl::Utils

#is_large_ttl?, #sanitize_ttl, #ttl_to_timestamp

Constructor Details

#initialize(options = nil) ⇒ CouchbaseStoreWithSaneTtl

Returns a new instance of CouchbaseStoreWithSaneTtl.



11
12
13
14
15
# File 'lib/active_support/cache/couchbase_store_with_sane_ttl.rb', line 11

def initialize(options = nil)
  options = options || {}
  extract_large_default_ttl! options, [:default_ttl, :expires_in]
  super options
end

Instance Method Details

#decrement(name, amount = 1, options = nil) ⇒ Object



23
24
25
26
27
# File 'lib/active_support/cache/couchbase_store_with_sane_ttl.rb', line 23

def decrement(name, amount = 1, options = nil)
  options = options || {}
  sanitize_ttl_options! options, [:ttl, :expires_in], :expires_in
  super name, amount, options
end

#increment(name, amount = 1, options = nil) ⇒ Object



17
18
19
20
21
# File 'lib/active_support/cache/couchbase_store_with_sane_ttl.rb', line 17

def increment(name, amount = 1, options = nil)
  options = options || {}
  sanitize_ttl_options! options, [:ttl, :expires_in], :expires_in
  super name, amount, options
end