From: "David A. Black" Date: 2004-09-10T19:29:03+09:00 Subject: Re: Aliasing a singleton method of a Class object Hi -- On Fri, 10 Sep 2004, Yuri Leikind wrote: > Hello all, > > Aliasing an object method is simple: > > > class QQQ > def aaa > end > > alias_method(:new_name_for_aaa, :aaa) > end > > > How do I alias a singleton method of a Class object (or, as many call it, a class method) ? > > > class QQQ > def self.aaa > end > end You have to get into the class where the singleton method is defined -- namely, the singleton class of the object QQQ: class << QQQ alias_method(:new_name_for_aaa, :aaa) end David -- David A. Black dblack@wobblini.net