Hi,
I was wondering if it is possible to create aliases for class methods,
as alias_method seems to work only for instance methods.
Thanks in advance
Hi –
On Sat, 16 Jun 2007, Borja Martín wrote:
Hi,
I was wondering if it is possible to create aliases for class methods, as
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