lookup_store(*store_option)
Class Public methods
Creates a new CacheStore object according to the given options.
If no arguments are passed to this method, then a new ActiveSupport::Cache::MemoryStore object will be returned.
If you pass a Symbol as the first argument, then a corresponding cache store class under the ActiveSupport::Cache namespace will be created. For example:
1 2 3 4 5 | ActiveSupport::Cache.lookup_store( :memory_store ) # => returns a new ActiveSupport::Cache::MemoryStore object ActiveSupport::Cache.lookup_store( :mem_cache_store ) # => returns a new ActiveSupport::Cache::MemCacheStore object |
Any additional arguments will be passed to the corresponding cache store class's constructor:
1 2 | ActiveSupport::Cache.lookup_store( :file_store , '/tmp/cache' ) # => same as: ActiveSupport::Cache::FileStore.new('/tmp/cache') |
If the first argument is not a Symbol, then it will simply be returned:
1 2 | ActiveSupport::Cache.lookup_store(MyOwnCacheStore. new ) # => returns MyOwnCacheStore.new |
Please login to continue.