From: Rick DeNatale Date: 2009-04-07T06:13:47+09:00 Subject: Re: Method missing and arrays as arguments.. --0016361e88c6555a850466e962c2 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit On Mon, Apr 6, 2009 at 5:00 PM, Gary Wright wrote: > > On Apr 6, 2009, at 4:35 PM, Kyle Schmitt wrote: > > How do you go about passing arrays as arguments to something like >> method_missing? I've got a method that takes an array as an argument, >> but calling it via method_missing is proving problematic. How do you >> deal with arrays in these situations? >> >> def method_missing(method,*args) >> if respond_to?method.to_s[/^add_([^$]+)/,1] >> @data<> else >> super method_missing(method,*args) >> end >> end >> > > > I think your problem is in the else clause. It should be: > > else > super > end > > You don't want to call method_missing explicitly, you'll create an infinite > recursion. > > Well, that's another problem, which I overlooked in MY response. -- Rick DeNatale Blog: http://talklikeaduck.denhaven2.com/ Twitter: http://twitter.com/RickDeNatale WWR: http://www.workingwithrails.com/person/9021-rick-denatale LinkedIn: http://www.linkedin.com/in/rickdenatale --0016361e88c6555a850466e962c2--