Class: Cache

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

Class Method Summary collapse

Class Method Details

.read(key) ⇒ Object



6
7
8
# File 'lib/cache.rb', line 6

def self.read(key)
  store.read(key)
end

.storeObject



2
3
4
# File 'lib/cache.rb', line 2

def self.store
  @store ||= ActiveSupport::Cache::MemoryStore.new
end

.write(key, value, expires_in: nil) ⇒ Object



10
11
12
# File 'lib/cache.rb', line 10

def self.write(key, value, expires_in: nil)
  store.write(key, value, expires_in: expires_in)
end