I'd like to do:
def one
puts __method__
end
alias :two :one
one
=> one
two
=> two
···
_____
However, both print "one".
My idea was to define several similar methods this way, as an
alternative to using a eval loop (which works). This is much like the
"$0" in a shell script. If the program is aliased, you get the alias
(name by which it was called).
--
Posted via http://www.ruby-forum.com/.