Calling instance method defined in a parent class?

How do I do that? Consider the following class definitions:

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.

On Sep 26, 5:16 pm, “Christopher J. Bottaro” [email protected]
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

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.