From: Brian Date: 2006-12-08T20:23:53+09:00 Subject: Re: Calling super in overwritten methods Hey, Assuming your trying to make a determination in class B as to which method to use, you could make method2 a class method. class A def method1 A.method2 end def self.method2 return 100 end end class B < A def method1 x = 1 puts A.method2 if x == 1 # => 100 puts method2 if x == 2 # => 200 end def method2 return 200 end end B.new.method1 - Brian On Dec 6, 5:36 am, Joerg Diekmann wrote: > Hi - not sure if this is possible - but it feels like it could be with > some serious ruby-fu. > > I have the following: > > class A > def method1 > method2 > end > > def method2 > return 100 > end > end > > class B < A > def method1 > super > end > > def method2 > return 200 > end > end > > This is what happens: > > b.method1 # 200 > > But, what I want is: > > b.method1 # 100 > > Is this possible at all? > > Thanks > Joerg > > -- > Posted viahttp://www.ruby-forum.com/.