From: "Mauricio Fernández" Date: 2004-08-31T16:28:18+09:00 Subject: Re: Object#undef_method ??? On Tue, Aug 31, 2004 at 03:20:04PM +0900, Gavin Sinclair wrote: > You can remove a method from a class or module using Module#remove_method > and Module#undef_method. What if the method you are trying to get rid of > is a _singleton_ method? > > For instance, > > module X > def X.foo() 4 end > end > > X.foo # -> 4 > > # Some code goes here. class << X; undef_method :foo end > X.foo # -> NameError: undefined method `foo' for X:module [1] > > Please write the code in the placeholder. > > [1] Or 'NoMethodError'; I can't tell which is which. ============= -- Running Debian GNU/Linux Sid (unstable) batsman dot geo at yahoo dot com