From: Guest Date: 2006-05-02T06:57:00+09:00 Subject: Re: getting the name of arguments a method takes Didier Prophete wrote: > I am wondering if there is a way to programatically get the name of the > arguments a function take. > > Say, I have this code: > class MyClass > def my_fct(a, b, c) > end > end > > Now, I can easily get a handle to the method 'my_fct' using: > mc = MyClass.new > meth = mc.method(:my_fct) > > But how do I get to the list of arguments of 'my_fct' ? I couldn't find > anything like: > meth.arg_list > which would return [ :a, :b, :c ], or something like that. > > Is this even possible in ruby ? > > -Didier i also would like to do this. anybody know if it's possible, and also getting arg names from a proc? if so it would be very handy for metaprogramming. thanks -- Posted via http://www.ruby-forum.com/.