instiki/vendor/rails/activesupport/lib/active_support/cache/memory_store.rb
Jacques Distler 7600aef48b Upgrade to Rails 2.2.0
As a side benefit, fix an (non-user-visible) bug in display_s5().
Also fixed a bug where removing orphaned pages did not expire cached summary pages.
2008-10-27 01:47:01 -05:00

39 lines
668 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.freeze
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 exist?(name,options = nil)
super
@data.has_key?(name)
end
def clear
@data.clear
end
end
end
end