Class: LockBoxCache::Cache

Inherits:
Object
  • Object
show all
Extended by:
Forwardable
Defined in:
lib/lockbox_cache.rb

Defined Under Namespace

Classes: HashCache, RailsCache

Instance Method Summary collapse

Constructor Details

#initialize(use_rails_cache = true) ⇒ Cache

Returns a new instance of Cache.



40
41
42
43
44
45
46
# File 'lib/lockbox_cache.rb', line 40

def initialize(use_rails_cache=true)
  if use_rails_cache && defined?(Rails)
    @cache = RailsCache.new
  else
    @cache = HashCache.new
  end
end