widmannm
9/27/2007 1:04:00 AM
On Sep 26, 5:16 pm, "Christopher J. Bottaro" <cjbott...@gmail.com>
wrote:
> How do I do that? Consider the following class definitions:
class Foo
def a
puts 'foo'
end
end
class Bar < Foo
alias b a
def a
puts 'bar'
end
end
Foo.new.a # => foo
Bar.new.a # => bar
Bar.new.b # => foo
> class Foo
> def a
> puts "Foo"
> end
> end
>
> class Bar < Foo
> def a
> puts "Bar"
> end
> def b
> parent.a # I want to call Foo#a here for this instance of Bar.
> end
> end
>
> Bar.new.b # => "Foo"
>
> Thanks for the help.
No problem.