module ActiveSupport::Cache

def lookup_store(*store_option)

# => returns MyOwnCacheStore.new
ActiveSupport::Cache.lookup_store(MyOwnCacheStore.new)

If the first argument is not a Symbol, then it will simply be returned:

# => same as: ActiveSupport::Cache::FileStore.new('/tmp/cache')
ActiveSupport::Cache.lookup_store(:file_store, '/tmp/cache')

class's constructor:
Any additional arguments will be passed to the corresponding cache store

# => returns a new ActiveSupport::Cache::MemCacheStore object
ActiveSupport::Cache.lookup_store(:mem_cache_store)

# => returns a new ActiveSupport::Cache::MemoryStore object
ActiveSupport::Cache.lookup_store(:memory_store)

For example:
store class under the ActiveSupport::Cache namespace will be created.
If you pass a Symbol as the first argument, then a corresponding cache

ActiveSupport::Cache::MemoryStore object will be returned.
If no arguments are passed to this method, then a new

Creates a new Store object according to the given options.
def lookup_store(*store_option)
  store, *parameters = *Array.wrap(store_option).flatten
  case store
  when Symbol
    retrieve_store_class(store).new(*parameters)
  when nil
    ActiveSupport::Cache::MemoryStore.new
  else
    store
  end
end