Class: Reviewed::Cache

Inherits:
Object
  • Object
show all
Includes:
Singleton
Defined in:
lib/reviewed/cache.rb

Class Method Summary collapse

Class Method Details

.storeObject



8
9
10
11
12
13
14
15
# File 'lib/reviewed/cache.rb', line 8

def self.store
  @store ||= if ENV['REVIEWED_CACHE_REDIS_URL']
               puts "Reviewed::Cache - connecting to #{ENV['REVIEWED_CACHE_REDIS_URL']}"
               ActiveSupport::Cache.lookup_store(:redis_store, ENV['REVIEWED_CACHE_REDIS_URL'])
             else
               ActiveSupport::Cache.lookup_store(:memory_store)
             end
end