Thanks. Using “method_defined?” worked around the problem.
From POP3 Tue Jul 16 16:22:52 EDT 2002
Date: Wed, 17 Jul 2002 05:22:16 +0900
Posted: Tue, 16 Jul 2002 15:28:01 -0500
From: “Hal E. Fulton” firstname.lastname@example.org
Subject: Re: alias_method problem
To: email@example.com (ruby-talk ML)
X-MLServer: fml [fml 3.0pl#17]; post only (anyone can post)
X-ML-Info: If you have a question, send e-mail with the body
"help" (without quotes) to the address firstname.lastname@example.org;
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2600.0000
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).
$aliased = $aliased || 0
if $aliased == 0 then
# method “newone” is defined in a different file.
alias_method :oldone, :newone
$aliased += 1
Hmmmm… I haven’t tested this, but here’s a
Could you test the value of "defined? oldone"
rather than resorting to a global variable?
Still a kludge, but maybe less so…