Module: AnyCache::Adapters::ActiveSupportFileStore::Fetching Private

Included in:
Decrement, Expire, Increment, Operation, Persist
Defined in:
lib/any_cache/adapters/active_support_file_store/fetching.rb

Overview

This module is part of a private API. You should avoid using this module if possible, as it may be removed or be changed in the future.

Since:

  • 0.1.0

Instance Method Summary collapse

Instance Method Details

#fetch_entry(key) ⇒ NilClass, ActiveSupport::Cache::Entry

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Parameters:

  • key (String)

Returns:

  • (NilClass, ActiveSupport::Cache::Entry)

Since:

  • 0.1.0



12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
# File 'lib/any_cache/adapters/active_support_file_store/fetching.rb', line 12

def fetch_entry(key)
  driver.instance_eval do
    read_options   = merged_options(nil)
    searched_entry = nil

    search_dir(cache_path) do |fname|
      entry_object = read_entry(fname, read_options)
      entry_name   = file_path_key(fname)

      searched_entry = entry_object if entry_name == key
    end

    searched_entry
  end
end