From: ts Date: 2001-11-01T02:47:03+09:00 Subject: [ruby-talk:23996] Re: Strangeness with undefining methods >>>>> "P" == Paul Brannan writes: P> In what real world situation might I use undef instead of remove_method? One case is (probably there are others) pigeon% cat b.rb #!/usr/bin/ruby class A def a puts "A#a" end end class B < A def a puts "B#a" end end class B; undef :a; end begin B.new.a rescue NameError p $! end class B; remove_method :a; end B.new.a pigeon% pigeon% b.rb #> A#a pigeon% P> And when I undef a method, where does the method go, since I can't call P> it? (I've noticed that I can still call remove_method after an undef). The method is still here but has no body, and ruby test this before calling a method Guy Decoux