From: "David A. Black" Date: 2005-09-14T21:32:17+09:00 Subject: Re: extend question --8323328-195993639-1126701134=:28844 Content-Type: MULTIPART/MIXED; BOUNDARY="8323328-195993639-1126701134=:28844" This message is in MIME format. The first part should be readable text, while the remaining parts are likely unreadable without MIME-aware tools. --8323328-195993639-1126701134=:28844 Content-Type: TEXT/PLAIN; charset=X-UNKNOWN; format=flowed Content-Transfer-Encoding: QUOTED-PRINTABLE Hi -- On Wed, 14 Sep 2005, Sebastian [iso-8859-1] Pad=F3 wrote: > Hello everybody, > > I apologize if this a stupid question - but I'd be very grateful for > any hints! > > Short Problem > ------------- > Is there a way of _forcing_ methods to be > overwritten when including a module? You can dup the module: module A def x puts "A" end end module B def x puts "B" end end obj =3D Object.new obj.extend(A).x # A obj.extend(B).x # B obj.extend(A).x # B obj.extend(A.dup).x # A I'm not sure whether there are hidden pitfalls to this, perhaps involving constants. David --=20 David A. Black dblack@wobblini.net --8323328-195993639-1126701134=:28844-- --8323328-195993639-1126701134=:28844--