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.

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.

···

On Sep 26, 5:16 pm, "Christopher J. Bottaro" <cjbott...@gmail.com> wrote: