class ActiveSupport::Cache::Store

def fetch_multi(*names)


# => { "bam" => "bam", "boom" => "boomboom" }
cache.fetch_multi("bim", "boom") { |key| key * 2 }
cache.write("bim", "bam")

Returns a hash with the data for each of the names. For example:

Options are passed to the underlying cache implementation.

and the result will be written to the cache and returned.
the supplied block is called for each key for which there was no data,
the cache with the given keys, then that data is returned. Otherwise,
Fetches data from the cache, using the given keys. If there is data in
def fetch_multi(*names)
  options = names.extract_options!
  options = merged_options(options)
  results = read_multi(*names, options)
  names.each_with_object({}) do |name, memo|
    memo[name] = results.fetch(name) do
      value = yield name
      write(name, value, options)
      value
    end
  end
end