Silly codeing error

A

Adrian Roskrow

Hi
I am a new programmer of ruby and am reading the pickaxe book. Working
through the examples to try out my new spiffy ruby ide I thought I would
try some very basic code from the book as below:

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

song = Song.new("Bicyclops" , "Fleck" , 260)
song.inspect

Now this fails with the following error `initialize': wrong number of
arguments (3 for 0) (ArgumentError)

I can see no error with this, has anyone got any ideas?

Adrian
 
W

Wilson Bilkovich

Hi
I am a new programmer of ruby and am reading the pickaxe book. Working
through the examples to try out my new spiffy ruby ide I thought I would
try some very basic code from the book as below:

def initiialize( name, artist, duration)

Check the spelling there. :)
 
T

Tim Pease

Hi
I am a new programmer of ruby and am reading the pickaxe book. Working
through the examples to try out my new spiffy ruby ide I thought I would
try some very basic code from the book as below:

class Song
def initiialize( name, artist, duration)

def initialize( name, artist, duration )

# one too many 'i' characters in "initialize"
 

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
474,260
Messages
2,571,039
Members
48,768
Latest member
first4landlord

Latest Threads

Top