From: Alexandru Popescu Date: 2005-08-21T03:09:46+09:00 Subject: Re: Ruby beginner question #: chris changed the world a bit at a time by saying on 8/20/2005 7:51 PM :# > Alucard wrote: >> Hello >> >> I am very new to Ruby and currently install Ruby 1.82.15 >> >> My question, what's wrong with the following code? > > New to ruby too, but it looks like you're calling + on "super" and on a > string. > > Try super.to_s + " [#{@lyrics}]" in to_s > > I think you should write it: class Song [....] def to_s "Song: #{@name}--#{@artist} (#{@duration})" end end class KaraokeSong [...] def to_s super + + " [#{@lyrics}]" end end [...] puts aSong.to_s :alex |.::the_mindstorm::.|