From: "RubyTalk@..." Date: 2007-04-16T10:04:29+09:00 Subject: Re: Undefining a method? ------=_Part_38629_13848086.1176685467250 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline undef :method irb(main):001:0> def cow irb(main):002:1> p "cow" irb(main):003:1> end => nil irb(main):004:0> cow "cow" => nil irb(main):005:0> undef :cow => nil irb(main):006:0> cow NameError: undefined local variable or method `cow' for main:Object from (irb):6 irb(main):007:0> Stephen Becker IV On 4/15/07, Ben Johnson wrote: > > Is it possible to undefine a method. For example: > > class A > def method > end > end > > A.undefine_method(:method) > > Is this possible? > > I need to do this because I'm dynamically building methods into a class > and it would make everything cleaner. > > -- > Posted via http://www.ruby-forum.com/. > > ------=_Part_38629_13848086.1176685467250--