Class: ActiveSupport::Cache::Strategy::LocalCache::LocalCacheRegistry
- Extended by:
- PerThreadRegistry
- Defined in:
- lib/active_support/cache/strategy/local_cache.rb
Overview
Class for storing and registering the local caches.
Class Method Summary collapse
Instance Method Summary collapse
- #cache_for(local_cache_key) ⇒ Object
-
#initialize ⇒ LocalCacheRegistry
constructor
A new instance of LocalCacheRegistry.
- #set_cache_for(local_cache_key, value) ⇒ Object
Methods included from PerThreadRegistry
Constructor Details
#initialize ⇒ LocalCacheRegistry
Returns a new instance of LocalCacheRegistry.
20 21 22 |
# File 'lib/active_support/cache/strategy/local_cache.rb', line 20 def initialize @registry = {} end |
Class Method Details
.cache_for(l) ⇒ Object
33 |
# File 'lib/active_support/cache/strategy/local_cache.rb', line 33 def self.cache_for(l); instance.cache_for l; end |
.set_cache_for(l, v) ⇒ Object
32 |
# File 'lib/active_support/cache/strategy/local_cache.rb', line 32 def self.set_cache_for(l, v); instance.set_cache_for l, v; end |
Instance Method Details
#cache_for(local_cache_key) ⇒ Object
24 25 26 |
# File 'lib/active_support/cache/strategy/local_cache.rb', line 24 def cache_for(local_cache_key) @registry[local_cache_key] end |
#set_cache_for(local_cache_key, value) ⇒ Object
28 29 30 |
# File 'lib/active_support/cache/strategy/local_cache.rb', line 28 def set_cache_for(local_cache_key, value) @registry[local_cache_key] = value end |