3 ms·
I would memoize with an alias_method wrapper and let it hit a cache_hash before calling the original function. This is a generic pattern that should work for al
by crb002 13y ago
I would memoize with an alias_method wrapper and let it hit a cache_hash before calling the original function. This is a generic pattern that should work for all immutable functions.
http://stackoverflow.com/questions/21790868/simple-aspect-oriented-duck-typing-in-ruby http://stackoverflow.com/questions/21790868/simple-aspect-or...