From: Lars Haugseth Date: 2009-02-04T08:14:52+09:00 Subject: Re: FInding out the name of the method from which I was called? * "R. Pito Salas" wrote: > > Is there a clever meta programming way for me to do this: > > def calling_method_1 > > reporting_method > > end > > > def reporting_method_2 > > puts "Hey I was just called from #{magic}" > > end > > and when running reporting_method_2 this prints > > Hey I was just called from calling_method_1 > > Thanks for any pointers! Kernel#caller http://www.ruby-doc.org/core/classes/Kernel.html#M005955 -- Lars Haugseth "If anyone disagrees with anything I say, I am quite prepared not only to retract it, but also to deny under oath that I ever said it." -Tom Lehrer