Module: CacheMethod::InstanceMethods
- Defined in:
- lib/cache_method.rb
Overview
All Objects, including instances and Classes, get the #cache_method_clear method.
Instance Method Summary collapse
-
#cache_method_clear(method_id) ⇒ Object
Clear the cache for a particular method.
Instance Method Details
#cache_method_clear(method_id) ⇒ Object
Clear the cache for a particular method.
Note: Remember to define #as_cache_key on any object whose instance methods might get cached.
Example:
my_blog.cache_method_clear :get_latest_entries
31 32 33 34 35 36 37 |
# File 'lib/cache_method.rb', line 31 def cache_method_clear(method_id) if ::CacheMethod.config.generational? ::CacheMethod::Generation.new(self, method_id).mark_passing else raise ::RuntimeError, "[cache_method] cache_method_clear called, but you have disabled generational caching. Check your setting for CacheMethod.config.generational" end end |