Sha256: 7c2ef4ba5f0390fa5a18f98baa7d8e986fa45ae45a0176bd4f1a2cb8610c7e00
Contents?: true
Size: 760 Bytes
Versions: 33
Compression:
Stored size: 760 Bytes
Contents
module AmaLayout module Notifications class RedisStore < AbstractStore delegate :clear, to: :base attr_accessor :base def initialize(opts = {}) self.base = ActiveSupport::Cache.lookup_store( :redis_store, opts.merge(raw: true) ) end def get(key, opts = {}) if opts.fetch(:default, false) base.fetch(key) { opts[:default] } else base.read(key) end end def set(key, value, opts = {}) base.write(key, value, opts) == 'OK' end def delete(key, opts = {}) base.delete(key, opts) == 1 end def transaction base.data.multi do yield self end end end end end
Version data entries
33 entries across 33 versions & 1 rubygems