From: Daniel Berger Date: 2010-10-15T08:17:57+09:00 Subject: Re: Is it possible to find out if an identifier is a method alias? On 10/14/10 4:48 PM, Ammar Ali wrote: >>> def method; end > => nil >>> alias :method_alias :method > => nil >>> defined? method > => "method" >>> defined? method_alias > => "method" > > The above makes perfect sense, but is there a way to determine if an > identifier is an alias? > > I don't have any practical use for such functionality. I'm purely > curious if there is a way to do it. class Foo def alpha; end def beta; end alias gamma alpha end Foo.instance_method(:alpha) == Foo.instance_method(:beta) # => false Foo.instance_method(:alpha) == Foo.instance_method(:gamma) # => true Regards, Dan