method
lookup_store
v2.1.0 -
Show latest stable
- Class:
ActiveSupport::Cache
lookup_store(*store_option)public
No documentation available.
# File activesupport/lib/active_support/cache.rb, line 5
def self.lookup_store(*store_option)
store, *parameters = *([ store_option ].flatten)
case store
when Symbol
store_class_name = (store == :drb_store ? "DRbStore" : store.to_s.camelize)
store_class = ActiveSupport::Cache.const_get(store_class_name)
store_class.new(*parameters)
when nil
ActiveSupport::Cache::MemoryStore.new
else
store
end
end 1Note
Creating additional cache stores
This method can be used to create additional cache stores for your application:
# creates a new Memory Store
mem_store = ActiveSupport::Cache.lookup_store
# creates a new MemCache Store
mem_cache_store = ActiveSupport::Cache.lookup_store :mem_cache_store, 'localhost:11212', :namespace => 'other_stuff'
The method takes the same arguments as the +cache_store+ config. For more information about that go to ActionController::Caching.