Class: LockBoxCache::Cache

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

Defined Under Namespace

Classes: HashCache

Instance Method Summary collapse

Constructor Details

#initialize(use_rails_cache = true) ⇒ Cache

Returns a new instance of Cache.



30
31
32
33
34
35
36
# File 'lib/lockbox_cache.rb', line 30

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