Module: Ramaze::Helper::Cache::SingletonMethods

Defined in:
lib/ramaze/helper/cache.rb

Instance Method Summary collapse

Instance Method Details

#cache(name, hash = {}) ⇒ Object



69
70
71
72
# File 'lib/ramaze/helper/cache.rb', line 69

def cache(name, hash = {})
  Ramaze.deprecated('Helper::Cache::cache', 'Helper::Cache::cache_action')
  cache_action(hash.merge(:method => name))
end

#cache_action(hash, &block) ⇒ Object



74
75
76
77
78
# File 'lib/ramaze/helper/cache.rb', line 74

def cache_action(hash, &block)
  hash[:key] = block if block_given?
  hash[:method] = hash[:method].to_s
  trait[:cache_action] << hash
end