Module: Rails
- Defined in:
- lib/multi_cache/rails.rb,
lib/multi_cache/rails/application/configuration.rb,
lib/multi_cache/rails/application/multi_cache_bootstrap.rb
Defined Under Namespace
Classes: Application
Class Method Summary collapse
Class Method Details
.cache(name = :default) ⇒ Object
15 16 17 18 |
# File 'lib/multi_cache/rails.rb', line 15 def cache(name = :default) return nil unless defined? @cache @cache[name] end |
.cache=(cache_obj) ⇒ Object
3 4 5 6 7 8 9 10 11 12 13 |
# File 'lib/multi_cache/rails.rb', line 3 def cache=(cache_obj) @cache = {} unless defined? @cache case cache_obj when Hash key = cache_obj[:name] @cache[key] = cache_obj[:cache] else @cache[:default] = cache_obj end nil end |