Class: Catche::Adapter::Base

Inherits:
Object
  • Object
show all
Defined in:
lib/catche/adapter/base.rb

Class Method Summary collapse

Class Method Details

.adapterObject



19
20
21
# File 'lib/catche/adapter/base.rb', line 19

def adapter
  Rails.cache
end

.delete(key) ⇒ Object



15
16
17
# File 'lib/catche/adapter/base.rb', line 15

def delete(key)
  adapter.delete(key)
end

.read(key, default_value = nil) ⇒ Object



7
8
9
# File 'lib/catche/adapter/base.rb', line 7

def read(key, default_value=nil)
  adapter.read(key) || default_value
end

.write(key, value) ⇒ Object



11
12
13
# File 'lib/catche/adapter/base.rb', line 11

def write(key, value)
  adapter.write(key, value)
end