From: Anthony Metcalf Date: 2009-11-10T06:51:32+09:00 Subject: Re: wrong number of arguments in initialize --------------enig0DAB019DDB98EFA6CD860565 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Arti Singh wrote: > I tried to initalize my methods and I get an error > def initialize(name,browser,username) > =20 You define intialize to ask for 3 arguments, you don't give any of them defaults..... > @s_name=3Dname > @browser=3Dbrowser > @username=3Dusername > end #def initialize(dc) > =20 > attr_accessor :name,:browser,:username > > > > > C:/RubyInstall/ruby/lib/ruby/1.8/test/unit/testcase.rb:59:in > `initialize': wrong number of arguments (1 for 3) (ArgumentError) > > =20 You don't show where you call the initialize method, but the error says you only gave one argument, and that it was called on line 59... > I honestly dont get it now, this is silly > =20 I get bit by this one all the time :) --------------enig0DAB019DDB98EFA6CD860565 Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.13 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iEYEARECAAYFAkr4j0IACgkQtUxufNRmXkGZFwCfZIgLMDmEKBrcjYIPXRG4grnI sZ4An34l2kvp14UimhIsDZ6TFs+/vwam =kXNN -----END PGP SIGNATURE----- --------------enig0DAB019DDB98EFA6CD860565--