From: Siep Korteling Date: 2008-07-14T05:32:32+09:00 Subject: Re: Passing arguments to a class, how do? I単aki Baz Castillo wrote: > El Domingo, 13 de Julio de 2008, Luiz Vitor Martinez Cardoso escribi坦: >> object = Person.new >> object.namer = (how to pass the params here) ? > > I don't know why but it's not possible to define an instance method > sufixed > with "=" and requiring more than one parameter, it gives an error when > passing parameters: > > irb> object.namer=("NAME","SURNAME") > SyntaxError: compile error > (irb):34: syntax error, unexpected ',', expecting ')' > > But you can use "send": > > irb> object.send("namer=","NAME","SURNAME") So maybe the OP is happy with dropping the troublesome "=" in his method name. class Person def namer(name, surname) @var = name @car = surname end end object = Person.new object.namer("Boop","Betty") p object hth Siep -- Posted via http://www.ruby-forum.com/.