From: "Chr. Rippel" Date: 2002-01-31T08:24:45+09:00 Subject: Re: strange behavior "Paul Brannan" wrote in .... > 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. The problem might be that ``class_name" a.k.a. "thismethod'' would have to be a hidden parameter to make it accessible inside the method body - i.e. the general overhead is probably not worth the benefit this feature would provide. /Christoph