From: Corey Konrad <0011@...> Date: 2007-03-18T03:01:21+09:00 Subject: Re: inheritance question Rick Denatale wrote: > On 3/17/07, Corey Konrad <0011@hush.com> wrote: >> I am trying to figure out how inheritance works using the super method. >> With the sample code below i get the error that i dont have enough >> arguments for the constructor i dont understand why i am getting that >> error. >> > >> class Dog < Animal >> def initialize(color, age, sound) > super(color,age) >> @sound = sound >> end > > > Animals initialize method has two arguments. > > -- > Rick DeNatale > > My blog on Ruby > http://talklikeaduck.denhaven2.com/ i Know but i initialized all of them in this statement though I initialized the 2 in the super class and then the 1 in the subclass: dog = Dog.new("red", 25, "Bark") -- Posted via http://www.ruby-forum.com/.