From: petermichaux@... Date: 2005-11-05T03:07:09+09:00 Subject: Re: Class and Mixin with same method name problem Robert Klemme wrote: > petermichaux@yahoo.com wrote: > > How do I call the Burp whoAmI? method? > > You don't (although you could with > Burp.instance_method(:whoAmI?).bind(self).call). Messing like this with names is not advisable. Good to know that there is a way to do this. Too bad it is so messy though. I'm thinking about using two Rails plugins in one model class. Since rails has a magic after_find callback method I was thinking about using this in each plugin since the plugins can be used independently. Since my model must call both of these methods I will have a third after_find callback method in the model that calls the other two. Now why doesn't the example below make two who_am_i calls? One to Burp and one to Debug. It only calls Burp. > Note also that by > convention a) methods ending in a question mark are reserved for boolean > queries and b) Ruby uses lowe_case_method_names. :-) Good to know. I just cut and pasted the example from the the first edition of Ruby Programming http://www.ruby-doc.org/docs/ProgrammingRuby/html/tut_modules.html Peter module Debug def who_am_i "Debug" end end module Burp def who_am_i "Burp" end end class EightTrack include Burp include Debug def who_am_i Debug.instance_method(:who_am_i).bind(self).call Burp.instance_method(:who_am_i).bind(self).call end end et = EightTrack.new p et.who_am_i