From: dblack@... Date: 2007-06-16T06:45:49+09:00 Subject: Re: alias_method for static method ---2049402039-1354733574-1181943948=:1863 Content-Type: MULTIPART/MIXED; BOUNDARY="-2049402039-1354733574-1181943948=:1863" This message is in MIME format. The first part should be readable text, while the remaining parts are likely unreadable without MIME-aware tools. ---2049402039-1354733574-1181943948=:1863 Content-Type: TEXT/PLAIN; charset=X-UNKNOWN; format=flowed Content-Transfer-Encoding: QUOTED-PRINTABLE Hi -- On Sat, 16 Jun 2007, Borja Mart=EDn wrote: > Hi, > I was wondering if it is possible to create aliases for class methods, as= =20 > alias_method seems to work only for instance methods. > Thanks in advance Class methods are singleton methods defined in a class's singleton class. So, to get into the right scope you would do: class << YourClass and then you can use alias and/or alias_method. David --=20 * Books: RAILS ROUTING (new! http://safari.awprofessional.com/9780321509246) RUBY FOR RAILS (http://www.manning.com/black) * Ruby/Rails training & consulting: Ruby Power and Light, LLC (http://www.rubypal.com) ---2049402039-1354733574-1181943948=:1863-- ---2049402039-1354733574-1181943948=:1863--