-
Notifications
You must be signed in to change notification settings - Fork 0
A ruby plugin for caching methods, based on Rails cache
License
terrbear/caches_method
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
CachesMethod ============ This plugin lets you cache a method's execution for a specified period of time (defaults to 15) or until a method is called. Unfortunately, right now, you have to put the caches_method call *after* the related methods have been defined. If anyone has a suggestion how to alias a method before it's defined, it would be welcomed. The plugin was inspired by @bdainton, from this blog post: https://buddingrubyist.com/2008/10/14/alias_method_chaining-your-ar-associations-for-fun-and-profit/ Example ======= To use it: Class Foo < ActiveRecord::Base def takeover_world #REALLY INTENSIVE STUFF end def retreat #not so intense end caches_method :some_expensive_method, :expire_methods => [:retreat], :ttl => 2000.years end Copyright (c) 2008 [Terry Heath], released under the MIT license
About
A ruby plugin for caching methods, based on Rails cache
Resources
License
Stars
Watchers
Forks
Releases
No releases published
Packages 0
No packages published