ITP2 - OOP Tutorials - Inheritance - super

When called with specific arguments, eg. super(a, b), the specified
arguments will be sent up the method lookup chain. Let's see a quick
example:

class BadDog < Animal
  def initialize(age, name)
    super(name)
    @age = age
  end
end

BadDog.new(2, "bear")        => #<BadDog:0x007fb40b2beb68 @age=2,
@name="bear">

This is similar to our previous example, with the difference being that
super takes an argument, hence the passed in argument is sent to the
superclass. Consequently, in this example when a BadDog class is created
the passed in name argument ("bear") is passed to the superclass and set
to the @name instance variable.