aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/lib/active_support/cache/memory_store.rb
diff options
context:
space:
mode:
Diffstat (limited to 'activesupport/lib/active_support/cache/memory_store.rb')
-rw-r--r--activesupport/lib/active_support/cache/memory_store.rb25
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