Silly codeing error

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

···

--
Posted via http://www.ruby-forum.com/.

Check the spelling there. :slight_smile:

···

On 1/15/07, Adrian Roskrow <adrian@hang10systems.co.uk> wrote:

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)

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"

···

On 1/15/07, Adrian Roskrow <adrian@hang10systems.co.uk> wrote:

      @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

--
Posted via http://www.ruby-forum.com/\.

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

How have you spelt initialize??

Tim Pease wrote:

···

On 1/15/07, Adrian Roskrow <adrian@hang10systems.co.uk> wrote:

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"

Yes thank you I now know my error!!

--
Posted via http://www.ruby-forum.com/\.

David Madden wrote:

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

How have you spelt initialize??

Yes thank you I now know my error!!

···

--
Posted via http://www.ruby-forum.com/\.

Wilson Bilkovich wrote:

···

On 1/15/07, Adrian Roskrow <adrian@hang10systems.co.uk> wrote:

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. :slight_smile:

Yes thank you I now know my error!!

--
Posted via http://www.ruby-forum.com/\.