From: David Naseby Date: 2004-01-06T13:06:05+09:00 Subject: Re: Calling shadowed methods in an inherited object >-----Original Message----- >From: Charles Comstock [mailto:cc1@cec.wustl.edu] >If I have code like: > >class A > def foo > puts "A::foo" > end >end > >class B < A > def foo > puts "B::foo" > end > def bar > # call A::foo > end >end > >Is there a legal way to call A::foo from B::bar? Can't do a super.foo. An ugly unreliable hack might be: class A def foo puts "A::foo" end end class B < A alias_method :bar, :foo def foo puts "B::Foo" end end b = B.new b.foo b.bar David http://homepages.ihug.com.au/~naseby/