Module: Kaching::StorageProviders
- Defined in:
- lib/kaching/storage_providers/redis.rb,
lib/kaching/storage_providers/memory.rb
Defined Under Namespace
Classes: Memory
Class Method Summary collapse
Class Method Details
.Redis ⇒ Object
5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 |
# File 'lib/kaching/storage_providers/redis.rb', line 5 def self.Redis if @redis && !@redis.respond_to?(:fetch) def @redis.fetch(key, &block) value = get(key) if !value value = block.call set(key, value) end value end end @redis end |
.Redis=(adapter) ⇒ Object
22 23 24 |
# File 'lib/kaching/storage_providers/redis.rb', line 22 def self.Redis=(adapter) @redis = adapter end |