class MyStuff::Cache::MemoryCache
Hash-based cache.
This will not be shared between instances of the cache - for example, this means that it won’t be shared between all requests in a Passenger or pool-based setup.
Public Class Methods
new(options = {})
click to toggle source
Calls superclass method
MyStuff::Cache::Base::new
# File lib/my_stuff/cache/memory_cache.rb, line 11 def initialize options = {} @cache = Hash.new super options end
Public Instance Methods
get(keys, options = {})
click to toggle source
# File lib/my_stuff/cache/memory_cache.rb, line 16 def get keys, options = {} keys.map{|key| @cache[key]} end
set(values, options = {})
click to toggle source
# File lib/my_stuff/cache/memory_cache.rb, line 20 def set values, options = {} @cache.merge! values end