From: "ara.t.howard" Date: 2007-08-04T01:59:22+09:00 Subject: Re: Getting the 'Sender' or 'Caller' object of a method On Aug 3, 2007, at 7:19 AM, Peter Laurens wrote: > Hi, > > I am not having much luck in finding out how to get the calling object > of a method. > > Is there an implicit way that a method can get a pointer to the object > that called it, or do I have to write that explicitly, manually > including a 'sender' parameter for the method call myself? > > I have looked at 'caller' but can only coax a string out of it. > > Thanks in advance for your kind help! > > - Nex > -- > Posted via http://www.ruby-forum.com/. > in many contexts this will work: require 'binding_of_caller' def method caller = Binding_of_caller{|binding| eval 'self', binding} end notably NOT class methods though... a @ http://drawohara.com/ -- we can deny everything, except that we have the possibility of being better. simply reflect on that. h.h. the 14th dalai lama