diff options
author | José Valim <jose.valim@gmail.com> | 2009-09-20 12:07:21 -0300 |
---|---|---|
committer | José Valim <jose.valim@gmail.com> | 2009-09-20 12:07:21 -0300 |
commit | 4215e9ab936efca915ca998273d2fc0c46bb59b8 (patch) | |
tree | cfb67f70ce1ec8f95ea91c2b548666a87cea58f5 /activesupport/lib/active_support/cache/memory_store.rb | |
parent | 09f798ba18029363378d80b19f9f88a055c44bb2 (diff) | |
download | rails-4215e9ab936efca915ca998273d2fc0c46bb59b8.tar.gz rails-4215e9ab936efca915ca998273d2fc0c46bb59b8.tar.bz2 rails-4215e9ab936efca915ca998273d2fc0c46bb59b8.zip |
Instrumenting cache stores.
Diffstat (limited to 'activesupport/lib/active_support/cache/memory_store.rb')
-rw-r--r-- | activesupport/lib/active_support/cache/memory_store.rb | 25 |
1 files changed, 15 insertions, 10 deletions
diff --git a/activesupport/lib/active_support/cache/memory_store.rb b/activesupport/lib/active_support/cache/memory_store.rb index 21ba79cf3d..66ce1bc93a 100644 --- a/activesupport/lib/active_support/cache/memory_store.rb +++ b/activesupport/lib/active_support/cache/memory_store.rb @@ -20,28 +20,33 @@ module ActiveSupport end def read(name, options = nil) - super - @data[name] + super do + @data[name] + end end def write(name, value, options = nil) - super - @data[name] = (value.duplicable? ? value.dup : value).freeze + super do + @data[name] = (value.duplicable? ? value.dup : value).freeze + end end def delete(name, options = nil) - super - @data.delete(name) + super do + @data.delete(name) + end end def delete_matched(matcher, options = nil) - super - @data.delete_if { |k,v| k =~ matcher } + super do + @data.delete_if { |k,v| k =~ matcher } + end end def exist?(name,options = nil) - super - @data.has_key?(name) + super do + @data.has_key?(name) + end end def clear |