Asp Forum
Home
|
Login
|
Register
|
Search
Forums
>
comp.lang.ruby
Re: Sending Multiple Args to a Method Object
Eric Hodel
8/1/2006 11:41:00 PM
On Aug 1, 2006, at 4:04 PM, Harris Reynolds wrote:
> I am trying to call a method that has multiple arguments using
> reflection. However, when I invoke the method.call method passing
> the arguments as an array it chokes with the following error:
>
> ArgumentError (wrong number of arguments (1 for 4))
>
> The ruby interpreter thinks that my single array is the parameter I
> am passing in; however, the array I am passing in contains 4
> object that map directly to the 4 arguments the interpreter is
> looking for. Is there another way to accomplish this other than
> using method.call?
method.call(*[arg1, arg2, arg3, arg4])
--
Eric Hodel - drbrain@segment7.net -
http://blog.se...
This implementation is HODEL-HASH-9600 compliant
http://trackmap.rob...
Servizio di avviso nuovi messaggi
Ricevi direttamente nella tua mail i nuovi messaggi per
Re: Sending Multiple Args to a Method Object
Inserendo la tua e-mail nella casella sotto, riceverai un avviso tramite posta elettronica ogni volta che il motore di ricerca troverà un nuovo messaggio per te
Il servizio è completamente GRATUITO!
x
Login to ForumsZone
Login with Google
Login with E-Mail & Password