Klaus Fabritius <kfk / wasserhase.de> wrote:
> Hello!

> I want do do something like that:

> def foo
>   puts the_name_the_method_was_called_with
> end ; alias bar foo

> foo  =>  "foo"
> bar  =>  "bar"

> Is there a thing like the_name_the_method_was_called_with?

Hi,

I think this has been asked in the past; for example, see the thread
starting at http://www.ruby-talk.org/38976.  One of the answers (by
Matz) is to  extract it from 'caller(0)'.

Regards,

Bill