Re:AbstractQueryFactoryFactories and alias_method_chain: The...
by jherdman on Monday February 15, 2010 @03:39PM
(#1127422)
You're actually reimplementing some parts of Ruby that already exist: http://ruby-doc.org/core-1.8.7/classes/UnboundMethod.html
Re:AbstractQueryFactoryFactories and alias_method_chain: The...
by duairc on Monday February 15, 2010 @03:53PM
(#1127459)
Sorry, I'm not sure what you mean. What did I implement that already exists? The only method I added to UnboundMethod was origin, and I don't see a method on that page that does that.
These monkey patches constitute my solution to the problem:
You use this as follows: I'll admit that its implementation is pretty horrible, but I think the interface is much nicer: you pass in a function which specifies your new function in terms of the old one, which is always passed as the first argument.