From: "RĂ¼diger Bahns" Date: 2009-10-09T21:50:05+09:00 Subject: Re: String of Parameters used as parameter list botp schrieb: > On Fri, Oct 9, 2009 at 8:39 AM, James Somers wrote: > .. >> function_name = "some_function" >> function_args = "12, 14, 'james'" >> Klass.send function_name, function_args >> >> Is there any way to do this? I have looked at things like *args but I >> would really like to keep the signature of the function the same because >> it'd require a lot of refactoring otherwise. > > > 1 then you may need to adjust the calling, eg >>> Klass.send function_name, *function_args.split(",") The function_args were two Fixnums and one String, after this you have "12" and " 14" instead of the numbers. So you'd better put the args in an array (before they become Strings) and 'Marshal.dump array' this and later Klass.send function_name, *Marshal.load(function_args) We should use eval when there is another way. R.