Class: ActiveSupport::Cache::Strategy::LocalCache::LocalCacheRegistry

Inherits:
Object
  • Object
show all
Extended by:
PerThreadRegistry
Defined in:
activesupport/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

Methods included from PerThreadRegistry

extended, instance

Constructor Details

#initializeLocalCacheRegistry

Returns a new instance of LocalCacheRegistry.



18
19
20
# File 'activesupport/lib/active_support/cache/strategy/local_cache.rb', line 18

def initialize
  @registry = {}
end

Class Method Details

.cache_for(l) ⇒ Object



31
# File 'activesupport/lib/active_support/cache/strategy/local_cache.rb', line 31

def self.cache_for(l); instance.cache_for l; end

.set_cache_for(l, v) ⇒ Object



30
# File 'activesupport/lib/active_support/cache/strategy/local_cache.rb', line 30

def self.set_cache_for(l, v); instance.set_cache_for l, v; end

Instance Method Details

#cache_for(local_cache_key) ⇒ Object



22
23
24
# File 'activesupport/lib/active_support/cache/strategy/local_cache.rb', line 22

def cache_for(local_cache_key)
  @registry[local_cache_key]
end

#set_cache_for(local_cache_key, value) ⇒ Object



26
27
28
# File 'activesupport/lib/active_support/cache/strategy/local_cache.rb', line 26

def set_cache_for(local_cache_key, value)
  @registry[local_cache_key] = value
end