Class: ActiveSupport::Cache::Strategy::LocalCache::LocalStore
| Relationships & Source Files | |
| Super Chains via Extension / Inclusion / Inheritance | |
|
Class Chain:
|
|
|
Instance Chain:
|
|
| Inherits: |
ActiveSupport::Cache::Store
|
| Defined in: | activesupport/lib/active_support/cache/strategy/local_cache.rb |
Overview
Simple memory backed cache. This cache is not thread safe and is intended only for serving as a temporary memory cache for a single thread.
Class Attribute Summary
::ActiveSupport::Cache::Store - Inherited
| .instrument | :deprecated: |
| .instrument= | :deprecated: |
| .logger | |
Class Method Summary
Instance Attribute Summary
::ActiveSupport::Cache::Store - Inherited
| #logger, #options, | |
| #silence? | Alias for ActiveSupport::Cache::Store#silence. |
Instance Method Summary
- #clear(options = nil)
- #delete_entry(key, options)
- #read_entry(key, options)
- #write_entry(key, value, options)
::ActiveSupport::Cache::Store - Inherited
| #cleanup | Cleanup the cache by removing expired entries. |
| #clear | Clear the entire cache. |
| #decrement | Decrement an integer value in the cache. |
| #delete | Deletes an entry in the cache. |
| #delete_matched | Delete all entries with keys matching the pattern. |
| #exist? | Returns |
| #fetch | Fetches data from the cache, using the given key. |
| #fetch_multi | Fetches data from the cache, using the given keys. |
| #increment | Increment an integer value in the cache. |
| #mute | Silence the logger within a block. |
| #read | Fetches data from the cache, using the given key. |
| #read_multi | Read multiple values at once from the cache. |
| #silence, | |
| #silence! | Silence the logger. |
| #write | Writes the value to the cache, with the key. |
Constructor Details
.new ⇒ LocalStore
# File 'activesupport/lib/active_support/cache/strategy/local_cache.rb', line 37
def initialize super @data = {} end
Instance Method Details
#clear(options = nil)
[ GitHub ]# File 'activesupport/lib/active_support/cache/strategy/local_cache.rb', line 47
def clear( = nil) @data.clear end
#delete_entry(key, options)
[ GitHub ]# File 'activesupport/lib/active_support/cache/strategy/local_cache.rb', line 60
def delete_entry(key, ) !!@data.delete(key) end
#read_entry(key, options)
[ GitHub ]# File 'activesupport/lib/active_support/cache/strategy/local_cache.rb', line 51
def read_entry(key, ) @data[key] end
#write_entry(key, value, options)
[ GitHub ]# File 'activesupport/lib/active_support/cache/strategy/local_cache.rb', line 55
def write_entry(key, value, ) @data[key] = value true end