Sha256: 63e805320d1f7b85043b24d366abb3c439fb9cf98ab63fcca3243d9f8bde0b06
Contents?: true
Size: 933 Bytes
Versions: 14
Compression:
Stored size: 933 Bytes
Contents
module CanTango class Ability class Cache class SessionCache < BaseCache attr_accessor :session # will be called with :session => session (pointing to user session) def initialize name, options = {} super # will set all instance vars using options hash @cache = cache @cache.configure_with :type => :memory raise "SessionCache must be initialized with a :session option" if !session session[:rules_cache] = @cache end def store session[:rules_cache] end def load key store.load! key end def save key, rules store.save! key, rules end def invalidate! key store.delete key end def cache CanTango::Cache::HashCache.instance # CanTango::Cache::MonetaCache.instance end end end end end
Version data entries
14 entries across 14 versions & 1 rubygems