From: Logan Capaldo Date: 2006-01-18T11:40:02+09:00 Subject: Re: invalid_arity method similar to method missing ? --Apple-Mail-4-330995758 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII; delsp=yes; format=flowed On Jan 17, 2006, at 8:30 PM, Didier Prophete wrote: > The best I can do is get a handle to the 'method' object. Something > like: > meth = self.method(:f1) > > But I am stuck there... I would need something like: > meth.arg_list > which would return [ :arg1, :arg2 ], or something like that. I don't believe there is a way to get the argument names from inside ruby. Can you define these methods (f1 and friends) to take a hash instead? eg: f1(:arg1 => 1, :arg2 => 2) If you can't do this (you didn't write the functions) perhaps you need a more robust abstraction, something like a class called Invocation, or Call or something. eg class Call attr_accessor :target, :method_name, :arguments def argument_names ... # insert code here to list the names of the arguments end end Of course you'll still need a way to generate this list. Perhaps with RDoc. THis is a little complicated though, ideally you would simply have the functions take a hash as its single parameter as I mentioned. Still not quite sure what you are asking. --Apple-Mail-4-330995758--