From: Ryan Davis Date: 2010-01-27T07:25:02+09:00 Subject: Re: Find the parameters of each method in a class On Jan 26, 2010, at 13:30 , Chris Gunnels wrote: > Benoit Daloze wrote: >> In Ruby 1.9.2: >> >> irb(main):001:0> class C >> irb(main):002:1> def meth(a,bb, ccc = nil, &b) >> irb(main):003:2> end >> irb(main):004:1> end >> => nil >> irb(main):005:0> C.instance_method(:meth).parameters >> => [[:req, :a], [:req, :bb], [:opt, :ccc], [:block, :b]] >> >> But you will not get the names for C methods like String#tr, just the >> type of the parameters. >> >> 2010/1/26 Jason Roelofs : > > Dang thats awesome and exactly what I need! Why can't it be in 1.8? :( It can. Look at merb. I think it is in merb-param-protection. Much more hacky, but it works.