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
···
--
/**
* dagi3d v4 | http://dagi3d.net
*/
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
--
/**
* dagi3d v4 | http://dagi3d.net
*/
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
--
* 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)
Thanks a lot, it worked like a charm.
dblack@wobblini.net escribió:
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 advanceClass 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
--
/**
* dagi3d v4 | http://dagi3d.net
*/