instiki/vendor/rails/activesupport/lib/active_support/cache/memory_store.rb
Jacques Distler 5292899c9a Rails 2.1 RC1
Updated Instiki to Rails 2.1 RC1 (aka 2.0.991).
2008-05-17 23:22:34 -05:00

33 lines
575 B
Ruby

module ActiveSupport
module Cache
class MemoryStore < Store
def initialize
@data = {}
end
def read(name, options = nil)
super
@data[name]
end
def write(name, value, options = nil)
super
@data[name] = value
end
def delete(name, options = nil)
super
@data.delete(name)
end
def delete_matched(matcher, options = nil)
super
@data.delete_if { |k,v| k =~ matcher }
end
def clear
@data.clear
end
end
end
end