petermichaux / yahoo.com wrote:
> What if two moduals are included and each uses the same method name?
> In the example below the Debug whoAmI? method is called. 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.

Note also that "self.class.name" will always yield the same result 
regardless in which module the method was defined.  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. :-)

Kind regards

    robert


> Thanks,
> Peter
>
> module Debug
>  def whoAmI?
>    "#{self.class.name}"
>  end
> end
>
> module Burp
>  def whoAmI?
>    "Burp #{self.class.name}"
>  end
> end
>
> class EightTrack
>  include Burp
>  include Debug
>  def whoAmI?
>    super
>  end
> end
>
> et = EightTrack.new
>
> p et.whoAmI?