From: Joey Date: 2006-08-15T04:14:54+09:00 Subject: Re: Get formal parameter names of a method? ------=_Part_176652_30714290.1155582892150 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline Not that I know of but: def install_args [:tool,:packaging] end m = Equipment.new.method(:install) Equipment.new.method(:install_args) #m.arity # => 2 On 8/14/06, Jeff Cohen wrote: > > Is there a way to reflect on a method to get the declard names of the > parameters? > > class Equipment > > def install(tool, packaging) > end > > end > > I can do this: > > m = Equipment.new.method(:install) > m.arity # => 2 > > I want to somehow find out that the client code has declared the > parameters named 'tool' and 'packaging'. > > Is this possible somehow? I feel like it should be, but I can't quite > figure it out. > > Thanks! > Jeff > > -- > Posted via http://www.ruby-forum.com/. > > ------=_Part_176652_30714290.1155582892150--