From: "David A. Black" Date: 2009-09-17T21:02:59+09:00 Subject: Re: Monkey Patching 2 Methods, Overrides One Method, Not The Other Hi -- On Thu, 17 Sep 2009, MaggotChild wrote: > I'm monkey patching 2 methods of an existing module: some_method() and > another_method() > > Calling some_method() on an instance of class that includes the > original module works fine (calls the monkey patched version), but > when I call another_method() the original (not the monkey patched) > method is called. > > There is a lot of code, and I've tried to recreate the series of > includes with the below example, yet the example works! > > Given this, I hope that someone could still provide me with some > insight as to why this would happen I'm never quite sure what people mean by "monkey patching" -- it always sounds like deliberately doing something badly, so that having it not work shouldn't be a surprise :-) -- but I think I'd have to see code that exhibits the problem you're describing in order to analyze it. Can you look at the difference between your real code and your example, and try to spot what's not working? David -- David A. Black, Director Ruby Power and Light, LLC (http://www.rubypal.com) Ruby/Rails training, consulting, mentoring, code review Book: The Well-Grounded Rubyist (http://www.manning.com/black2)