From: Florian Gross Date: 2004-08-18T09:15:56+09:00 Subject: Re: Getting the binding of the caller Michael Neumann wrote: > 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". That's weird -- can't find an explanation for it, because the following works: require 'binding_of_caller' this = self class A def m Binding.of_caller do |binding| eval("this", binding) end end end p A.new.m # => main Maybe somebody has the knowledge needed to explain what's going on there? > Regards, > Michael More regards, Florian Gross