Method: Ramaze::Cache.add

Defined in:
lib/ramaze/cache.rb

.add(*keys) ⇒ Object

This will define a method to access a new cache directly over singleton-methods on Cache.


The @cache_name is internally used for caches which do not save different caches in different namespaces, for example memcached. +++



40
41
42
43
44
45
46
# File 'lib/ramaze/cache.rb', line 40

def add *keys
  keys.each{|key|
    klass = Global.cache_alternative.fetch(key, Global.cache)
    add_on(key, klass)
  }
  Log.dev("Added caches for: #{keys.join(', ')}")
end