W3cubDocs

/Ruby on Rails 7.0

class ActiveSupport::Cache::Strategy::LocalCache::LocalStore

Parent:
Object

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() Show source
# File activesupport/lib/active_support/cache/strategy/local_cache.rb, line 32
def initialize
  @data = {}
end

Public Instance Methods

clear(options = nil) Show source
# File activesupport/lib/active_support/cache/strategy/local_cache.rb, line 36
def clear(options = nil)
  @data.clear
end
delete_entry(key) Show source
# File activesupport/lib/active_support/cache/strategy/local_cache.rb, line 53
def delete_entry(key)
  [email protected](key)
end
read_entry(key) Show source
# File activesupport/lib/active_support/cache/strategy/local_cache.rb, line 40
def read_entry(key)
  @data[key]
end
read_multi_entries(keys) Show source
# File activesupport/lib/active_support/cache/strategy/local_cache.rb, line 44
def read_multi_entries(keys)
  @data.slice(*keys)
end
write_entry(key, entry) Show source
# File activesupport/lib/active_support/cache/strategy/local_cache.rb, line 48
def write_entry(key, entry)
  @data[key] = entry
  true
end

© 2004–2021 David Heinemeier Hansson
Licensed under the MIT License.