From: Michael Neumann Date: 2004-08-18T08:21:51+09:00 Subject: Re: Getting the binding of the caller Florian Gross wrote: > Michael Neumann wrote: >> Is there a way to get the binding of the caller? > > > Yup, there is. See the attached file. It's a bit obscure, but it works > and shouldn't be too slow. Thanks for the quick answer... uhm, but it does seem to behave as it should: require 'binding_of_caller' class A def m Binding.of_caller do |binding| eval("self", binding) end end end p A.new.m # => # I expect "self" to be "main". Regards, Michael