From: "Hal E. Fulton" Date: 2002-07-17T05:22:16+09:00 Subject: Re: alias_method problem ----- Original Message ----- From: "Steve Tuckner" To: "ruby-talk ML" Sent: Tuesday, July 16, 2002 3:09 PM Subject: RE: alias_method problem > I too have run in to this and implemented an ugly kludge to deal with it > (instead of taking the time to figure it out). > > class A > $aliased = $aliased || 0 > > if $aliased == 0 then > # method "newone" is defined in a different file. > alias_method :oldone, :newone > def newone > oldone > end > end > $aliased += 1 > end Hmmmm... I haven't tested this, but here's a thought: Could you test the value of "defined? oldone" rather than resorting to a global variable? Still a kludge, but maybe less so... Hal