Peter Szinek wrote:
> skt wrote:
>   
>> Ok, I'm doing the examples from
>> http://www.math.umd.edu/~dcarrera/ruby/0.3/chp_04/classes2.html
>>
>> Exactly as it's written on the page.
>> The first part returns fine, and then I start the second part with the
>> "sandy_addr = Address.new" and it gives me this.
>> irb(main):181:0> sandy_addr = Address.new
>> ArgumentError: wrong number of arguments (0 for 1)
>>        from (irb):181:in `initialize'
>>        from (irb):181
>>        from :0
>> irb(main):182:0>
>>
>> Anybody?
>>     
>
> I guess the problem could be here: (in Person.initialize)
>
> @address = Address.new
>
> since the initialize() of Address needs 1 param (and not 0):
>
> class Address
>     def initialize(street)
>         @street = street
>     end
> end
>
> i.e. the wrong line should read
>
> @address = Address.new('Calle Bolý◊ar, Buenos Aires')
>
> HTH,
> Peter
>
> __
> http://wwww.rubyrailways.com
>
>
>   
Also, there's a typo on the page that I was completely missing.
Thanks!

-- 
skt

shyguyfrenzy / gmail.com
"I sing a song, falling upon deaf ears; unsung."