From: Bertram Scharpf Date: 2005-05-29T02:18:29+09:00 Subject: Re: preventing Object#send from dispatching to a global method? Hi, Am Sonntag, 29. Mai 2005, 00:42:46 +0900 schrieb Francis Hwang: > Is there a way to prevent Object#send from dispatching to a global > method? By which I mean: > > def something; end > > class SomeClass > def method_missing( sym, *args ) .... do magic; end > end > > SomeClass.new.something # I'd like this to go to > SomeClass#method_missing, not Kernel#something class SomeClass undef something end Probably you thought of no specific method, so one should remove them all. This causes an error: class SomeClass Kernel.methods.each { |x| undef_method x.to_sym } end Is there a way to un-include? Bertram -- Bertram Scharpf Stuttgart, Deutschland/Germany http://www.bertram-scharpf.de