class ActiveSupport::Cache::Strategy::LocalCache::LocalStore
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.
Public Class Methods
new()
click to toggle source
Calls superclass method
ActiveSupport::Cache::Store::new
# File activesupport/lib/active_support/cache/strategy/local_cache.rb, line 39 def initialize super @data = {} end
Public Instance Methods
clear(options = nil)
click to toggle source
# File activesupport/lib/active_support/cache/strategy/local_cache.rb, line 49 def clear(options = nil) @data.clear end
delete_entry(key, options)
click to toggle source
# File activesupport/lib/active_support/cache/strategy/local_cache.rb, line 62 def delete_entry(key, options) !!@data.delete(key) end
read_entry(key, options)
click to toggle source
# File activesupport/lib/active_support/cache/strategy/local_cache.rb, line 53 def read_entry(key, options) @data[key] end
write_entry(key, value, options)
click to toggle source
# File activesupport/lib/active_support/cache/strategy/local_cache.rb, line 57 def write_entry(key, value, options) @data[key] = value true end