Class: Condenser::Cache::NullStore

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

Instance Method Summary collapse

Instance Method Details

#clear(options = nil) ⇒ Object

Public: Simulate clearing the cache

Returns true



34
35
36
# File 'lib/condenser/cache/null_store.rb', line 34

def clear(options=nil)
  true
end

#fetch(key) ⇒ Object



14
15
16
17
18
19
20
21
22
# File 'lib/condenser/cache/null_store.rb', line 14

def fetch(key)
  value = get(key)
  
  if value.nil?
    value = yield
    set(key, value)
  end
  value
end

#get(key) ⇒ Object



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

def get(key)
  nil
end

#inspectObject

Public: Pretty inspect

Returns String.



27
28
29
# File 'lib/condenser/cache/null_store.rb', line 27

def inspect
  "#<#{self.class}>"
end

#set(key, value) ⇒ Object



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

def set(key, value)
  value
end