Method: Merb::Cache::ControllerInstanceMethods#expire

Defined in:
lib/merb-cache/cache-fragment.rb

#expire(options) ⇒ Object

Expires the entry identified by the key computed after the parameters

Parameter

options<String,Hash>

The options that will be passed to #key_for

Examples

expire("my_key")
expire(:key => "my_", :match => true)
expire(:key => "my_key", :params => [session[:me], params[:ref]])


85
86
87
88
89
90
91
92
93
94
# File 'lib/merb-cache/cache-fragment.rb', line 85

def expire(options)
  Merb::Controller._cache.expire_key_for(options, controller_name) do |key, match|
    if match
      Merb::Controller._cache.store.expire_match(key)
    else
      Merb::Controller._cache.store.expire(key)
    end
  end
  true
end