Newbie question

L

Len Sumnler

I am just starting to learn Ruby. I am running Ruby under XP and have
entered a code example from the book "Programming Ruby The Pragmatic
Programmer's Guide".
Code example follows;

class Song
def intialize(name, artist, duration)
@name = name
@artist = artist
@duration = duration
end
end

aSong = Song.new("Hey Jude", "Beetles", 260)
aSong.inspect

I get the following error messages.

My_Class.rb:9:in `initialize': wrong number of arguments(3 for 0)
(ArgumentError)
from My_Class.rb:9:in `new'
from My_Class.rb:9

WHY

Len Sumnler
 
L

Len Sumnler

Sorry for the stupid question it was just to late.

Thanks for the second pair of eyes though
Len Sumnler
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,778
Messages
2,569,605
Members
45,237
Latest member
AvivMNS

Latest Threads

Top