Class: ActiveSupport::Cache::Strategy::LocalCache::LocalCacheRegistry
- Extended by:
- PerThreadRegistry
- Defined in:
- activesupport/lib/active_support/cache/strategy/local_cache.rb
Overview
Class for storing and registering the local caches.
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
Constructor Details
#initialize ⇒ LocalCacheRegistry
Returns a new instance of LocalCacheRegistry.
15 16 17 |
# File 'activesupport/lib/active_support/cache/strategy/local_cache.rb', line 15 def initialize @registry = {} end |
Instance Method Details
#cache_for(local_cache_key) ⇒ Object
19 20 21 |
# File 'activesupport/lib/active_support/cache/strategy/local_cache.rb', line 19 def cache_for(local_cache_key) @registry[local_cache_key] end |
#set_cache_for(local_cache_key, value) ⇒ Object
23 24 25 |
# File 'activesupport/lib/active_support/cache/strategy/local_cache.rb', line 23 def set_cache_for(local_cache_key, value) @registry[local_cache_key] = value end |