From: "Chr. Rippel" Date: 2002-01-31T06:44:34+09:00 Subject: Re: strange behavior From: "Paul Brannan" .... > Perhaps it would be nice if I could get information about the current > method being executed: > > class A > def b > thismethod.class.a > end > end > b = B.new > b.b #=> A.a Why not do this? class A def self.b A.a end end b.b # => A.a /Christoph /PS With a bit of cheating and a cvs version you can also create instance variables in a completely different context. Overall I find Ruby scoping rules really brillant - once you get the hang of them everything makes sense ... class A @@var = 5 K = 4 $peak = proc { puts [@@var, K] } end class C define_method (:peak,$peak) end C.new.peak # => 5,4