From: Paul Brannan Date: 2002-01-31T04:50:43+09:00 Subject: Re: strange behavior On Thu, Jan 31, 2002 at 04:18:27AM +0900, mengx@nielsenmedia.com wrote: > An indirectly related topic, A class method can not be called > within an instance without using the class name. > > class A > def A.a > end > > def b > a => error > A.a => ok. > end > end > > This also seems to be a surprise. Ruby class is itself an object > and this probably contributes to this behavior but I feel > it should be allowed. Would it be possible to change this. Currently, I can do this: class A def self.a puts "A.a" end def b self.class.a end end but it doesn't work with derived types: class B < A def self.a puts "B.a" end end b = B.new b.b #=> B.a 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 Just a thought. Paul