Announcement (2017-05-07): www.ruby-forum.com is now read-only since I
unfortunately do not have the time to support and maintain the forum any
more. Please see rubyonrails.org/community and ruby-lang.org/en/community
for other Rails- und Ruby-related community platforms.

Diego Virasoro wrote:
> Hello,> some methods require as an argument a symbol of a method (e.g.> alias_method). How can one use it with class methods?>> Thanks.>> Diego
class A
def A.show(symbol)
puts "%s <--> %s" % [symbol.inspect, symbol.to_s]
end
end
A.show(:hello)
--output:--
:hello <--> hello

Diego Virasoro wrote:
> Hello,> some methods require as an argument a symbol of a method (e.g.> alias_method). How can one use it with class methods?>
Hmm...what does 'it' refer to? Does 'it' refers to alias_method?
As far as I can tell, you can't use alias_method with symbols like:
:self.meth_name
for arguments. However, this seems to work:
class A
def self.greet
puts "hello"
end
class<<self
alias_method :old_greet, :greet
end
end
A.old_greet #hello