Method: ActiveSupport::Cache::FileStore#delete_matched

Defined in:
activesupport/lib/active_support/cache/file_store.rb

#delete_matched(matcher, options = nil) ⇒ Object



89
90
91
92
93
94
95
96
97
98
99
# File 'activesupport/lib/active_support/cache/file_store.rb', line 89

def delete_matched(matcher, options = nil)
  options = merged_options(options)
  matcher = key_matcher(matcher, options)

  instrument(:delete_matched, matcher.inspect) do
    search_dir(cache_path) do |path|
      key = file_path_key(path)
      delete_entry(path, **options) if key.match(matcher)
    end
  end
end