instance method
delete_matched
Ruby on Rails 7.0.10
Since v2.2.3Signature
delete_matched(matcher, options = nil)
Deletes cache entries if the cache key matches a given pattern.
Parameters
-
matcherreq -
optionsopt = nil
Source
# File activesupport/lib/active_support/cache/memory_store.rb, line 122
def delete_matched(matcher, options = nil)
options = merged_options(options)
instrument(:delete_matched, matcher.inspect) do
matcher = key_matcher(matcher, options)
keys = synchronize { @data.keys }
keys.each do |key|
delete_entry(key, **options) if key.match(matcher)
end
end
end
Defined in activesupport/lib/active_support/cache/memory_store.rb line 122
· View on GitHub
· Improve this page
· Find usages on GitHub
Defined in ActiveSupport::Cache::MemoryStore