From: Jason Roelofs Date: 2010-01-27T04:05:09+09:00 Subject: Re: Find the parameters of each method in a class --0016e64dc9a68abb83047e15f65c Content-Type: text/plain; charset=ISO-8859-1 You can find the arity of said methods, but afaik not the names of the parameters: CoolClass.instance_method(:method_one).arity # => 2 CoolClass.instance_method(:method_two).arity # => 3 Jason On Tue, Jan 26, 2010 at 1:51 PM, Chris Gunnels wrote: > Is there a way to find the parameters of each method in a class? For > instance I have a class like: > > class CoolClass > def meth_one(p1,p2) > ... > end > > def meth_two(p1,p2,p3) > ... > end > end > > I can run: > cc = CoolClass.new > cc.public_methods(false) > > and it will return an array of all the public methods > (['meth_one','meth_two']). > > Is there a way to find the parameters of each method from the example > above? > -- > Posted via http://www.ruby-forum.com/. > > --0016e64dc9a68abb83047e15f65c--