Sha256: 186824d76c08c28240255e38354aab749cc6b53949e64a975c4af2dd4e316a7b

Contents?: true

Size: 585 Bytes

Versions: 15

Compression:

Stored size: 585 Bytes

Contents

module ActiveSupport
  module Cache
    class MemcacheStore
      def initialize(cache)
        @cache = cache
      end

      def read(key, options = {})
        @cache.get(key, options)
      rescue Memcached::NotFound
        nil
      end

      def increment(key)
        @cache.incr(key)
      end

      def write(key, value, options = {})
        if expires_in = options.delete(:expires_in)
          options[:expiry] = expires_in.to_i
        end

        @cache.set(key, value, options)
      end

      def delete(key)
        @cache.delete(key)
      end
    end
  end
end

Version data entries

15 entries across 15 versions & 1 rubygems

Version Path
circuitbox-1.1.0 lib/circuitbox/memcache_store.rb
circuitbox-1.0.3 lib/circuitbox/memcache_store.rb
circuitbox-1.0.2 lib/circuitbox/memcache_store.rb
circuitbox-1.0.1 lib/circuitbox/memcache_store.rb
circuitbox-1.0.0 lib/circuitbox/memcache_store.rb
circuitbox-0.11.0 lib/circuitbox/memcache_store.rb
circuitbox-0.10.4 lib/circuitbox/memcache_store.rb
circuitbox-0.10.3 lib/circuitbox/memcache_store.rb
circuitbox-0.10.2 lib/circuitbox/memcache_store.rb
circuitbox-0.10.1 lib/circuitbox/memcache_store.rb
circuitbox-0.10.0 lib/circuitbox/memcache_store.rb
circuitbox-0.9.0 lib/circuitbox/memcache_store.rb
circuitbox-0.8.0 lib/circuitbox/memcache_store.rb
circuitbox-0.7.0 lib/circuitbox/memcache_store.rb
circuitbox-0.5.2 lib/circuitbox/memcache_store.rb