From: Joel VanderWerf Date: 2002-09-29T05:55:23+09:00 Subject: Re: alias versus method_missing Lyle Johnson wrote: > All, > > Before I make this harder than it is, I wanted to double-check. Let's > say I have a base class: > > class Base > def foo > puts "inside Base#foo" > end > end > > and another class derived from Base: > > class Derived < Base > def foo > puts "inside Derived#foo" > end > end ... > class Base > def method_missing(mid, *args) > case mid > when :bar > foo(*args) > else > super # hand off to Base's base class... > end > end > end Another reason not to use method_missing: Derived.new.bar # ==> inside Derived#foo class Object def bar puts "inside Object#bar" end end Derived.new.bar # ==> inside Object#bar The superclass has overriden the subclass!