class ActiveSupport::Cache::MultiStore
Public Class Methods
new(*stores)
click to toggle source
Calls superclass method
# File lib/active_support/cache/multi_store.rb, line 4 def initialize(*stores) @monitor = Monitor.new @stores = stores super(stores.extract_options!) end
send_to_all(*methods)
click to toggle source
# File lib/active_support/cache/multi_store.rb, line 10 def self.send_to_all(*methods) methods.each do |method| define_method method do |*args| synchronize do @stores.map { |store| store.send(method, *args) } end end end end
Private Instance Methods
promote_entry(key, entry, index)
click to toggle source
# File lib/active_support/cache/multi_store.rb, line 43 def promote_entry(key, entry, index) @stores.first(index).each do |store| store.write(key, entry.value) end end