From: Robert Feldt Date: 2001-02-20T02:09:00+09:00 Subject: [ruby-talk:11120] Re: Auto-magically determine your class/method in Ruby On Tue, 20 Feb 2001, Dave Thomas wrote: > Bryan Zarnett writes: > > > Is their a way to auto-magically determine the class > > and method that called an operation in another class. > > For example, I have a logger class that would like to > > embed in the output line the Class and operation that > > logged a message. I don't want to have to pass this > > information as an argument if I have to. > > This is Ruby. Of _course_ there is... :) > > > See, I told you. I never should have posted... :-) BTW, wouldn't it be nicer if Kernel#caller included the calling object and method? First time I encoutered it (the name) that's what I thought it did. /R