From: "ara.t.howard" Date: 2007-08-04T04:34:43+09:00 Subject: Re: Getting the 'Sender' or 'Caller' object of a method On Aug 3, 2007, at 11:50 AM, Trans wrote: > You can always take a block and get the binding from it: > > def method(&b) > callers_binding = b.send(:binding) > end > > I works always. Yes, it means passing a block, but sometimes that's > useful anyway. > ?? cfp:~ > cat a.rb def a &b eval 'self', b.send(:binding) end require 'binding_of_caller' def b Binding.of_caller{|binding| eval 'self', binding} end p self p a p b cfp:~ > ruby a.rb main nil main cfp:~ > ruby -v ruby 1.8.6 (2007-03-13 patchlevel 0) [i686-darwin8.9.1] am i misunderstanding? 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