From: Paul Brannan Date: 2002-01-31T07:52:27+09:00 Subject: Re: strange behavior On Thu, Jan 31, 2002 at 07:44:43AM +0900, Chr. Rippel wrote: > One problem is that at the ``time of method body declaration'' > you don't have access to the context - a.k.a binding. It's a bit like > the use of Pythons ``self'' variable - if don't spezify ``self'' you > cannot access self (in Python) The context is, however, known at the time that the method is called. I grant that it would be a bit surprising if I did this: class A def foo puts thismethod.class end end class B < A define_method :bar, method(:foo) end B.new.bar to see "B" printed to my screen, but this is probably not a common case, so creating thismethod at runtime is reasonable. thismethod could even itself be a method that instantiates a wrapper around the inspectible data. Paul