Class: Condenser::Cache::NullStore
- Inherits:
-
Object
- Object
- Condenser::Cache::NullStore
- Defined in:
- lib/condenser/cache/null_store.rb
Instance Method Summary collapse
-
#clear(options = nil) ⇒ Object
Public: Simulate clearing the cache.
- #fetch(key) ⇒ Object
- #get(key) ⇒ Object
-
#inspect ⇒ Object
Public: Pretty inspect.
- #set(key, value) ⇒ Object
Instance Method Details
#clear(options = nil) ⇒ Object
Public: Simulate clearing the cache
Returns true
33 34 35 |
# File 'lib/condenser/cache/null_store.rb', line 33 def clear(=nil) true end |
#fetch(key) ⇒ Object
13 14 15 16 17 18 19 20 21 |
# File 'lib/condenser/cache/null_store.rb', line 13 def fetch(key) value = get(key) if value.nil? value = yield set(key, value) end value end |
#get(key) ⇒ Object
5 6 7 |
# File 'lib/condenser/cache/null_store.rb', line 5 def get(key) nil end |
#inspect ⇒ Object
Public: Pretty inspect
Returns String.
26 27 28 |
# File 'lib/condenser/cache/null_store.rb', line 26 def inspect "#<#{self.class}>" end |
#set(key, value) ⇒ Object
9 10 11 |
# File 'lib/condenser/cache/null_store.rb', line 9 def set(key, value) value end |