Forum: Ruby Silly codeing error

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
Cc07c1f1c709ae4419d52ba19d87f5d0?d=identicon&s=25 Adrian Roskrow (madsurfer)
on 2007-01-15 20:10
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
25e11a00a89683f7e01e425a1a6e305c?d=identicon&s=25 Wilson Bilkovich (Guest)
on 2007-01-15 20:17
(Received via mailing list)
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. :)
4d5b5dd4e263d780a5dfe7ac8b8ac98c?d=identicon&s=25 Tim Pease (Guest)
on 2007-01-15 20:19
(Received via mailing list)
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"
5ef95bf95af5064ff3c2bcafa6a8a212?d=identicon&s=25 David Madden (Guest)
on 2007-01-15 20:32
(Received via mailing list)
>
> class Song
>     def initiialize( name, artist, duration)
>       @name = name
>       @artist = artist
>       @duration = duration
>     end
> end
>
>
How have you spelt initialize??
Cc07c1f1c709ae4419d52ba19d87f5d0?d=identicon&s=25 Adrian Roskrow (madsurfer)
on 2007-01-15 23:09
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!!
Cc07c1f1c709ae4419d52ba19d87f5d0?d=identicon&s=25 Adrian Roskrow (madsurfer)
on 2007-01-15 23:10
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!!
Cc07c1f1c709ae4419d52ba19d87f5d0?d=identicon&s=25 Adrian Roskrow (madsurfer)
on 2007-01-15 23:12
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. :)

Yes thank you I now know my error!!
This topic is locked and can not be replied to.