On this page
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
Calls superclass method ActiveSupport::Cache::Store.new
# File activesupport/lib/active_support/cache/strategy/local_cache.rb, line 37
def initialize
super
@data = {}
end
Public Instance Methods
# File activesupport/lib/active_support/cache/strategy/local_cache.rb, line 47
def clear(options = nil)
@data.clear
end
# File activesupport/lib/active_support/cache/strategy/local_cache.rb, line 60
def delete_entry(key, options)
!!@data.delete(key)
end
# File activesupport/lib/active_support/cache/strategy/local_cache.rb, line 51
def read_entry(key, options)
@data[key]
end
# File activesupport/lib/active_support/cache/strategy/local_cache.rb, line 55
def write_entry(key, value, options)
@data[key] = value
true
end
© 2004–2016 David Heinemeier Hansson
Licensed under the MIT License.