Alias_method for static method


#1

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


#2

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


#3

Thanks a lot, it worked like a charm.

removed_email_address@domain.invalid escribió: