From: "David A. Black" Date: 2004-11-01T05:02:23+09:00 Subject: Re: undef_method cutting off subclass's method lookup? Hi -- On Mon, 1 Nov 2004, trans. (T. Onoma) wrote: > > class Numeric > def succ > self + 1 > end > end > > class Integer > undef_method( :succ ) > end > > 2.class #=> Fixnum > 2.succ > NoMethodError: undefined method `succ' for 1:Fixnum > from (irb):10 > > > Shouldn't it be able to find #succ in the ancestor? From 'ri undef_method': ---------------------------------------------------- Module#undef_method undef_method(symbol) => self ------------------------------------------------------------------------ Prevents the current class from responding to calls to the named method. Contrast this with +remove_method+, which deletes the method from the particular class; Ruby will still search superclasses and mixed-in modules for a possible receiver. David -- David A. Black dblack@wobblini.net