From: Rick DeNatale Date: 2007-03-22T05:23:55+09:00 Subject: Ruby Method Signatures (was Re: Multiton in standard library) On 3/19/07, TRANS wrote: > Which reminds me, it would be nice of Method could return a > representation of a methods signature. I've run into this need > elsewhere too. Thinking about this a bit, I'm not sure how much more information a ruby method signature would have beyond the arity. all ruby methods return an object. all the parameters are objects. The parameter names don't seem to have any meaning to the caller. All methods can be called with a block (although it can be ignored, but then any other parameters can be ignored as well). So it seems to me that theres no difference between def a(&block) and def a The only information that I can think of that arity doesn't give you is in the case like: class C def a(*args) end def b(c=1) end end both methods have an arity of -1 which indicates that there are no required parameters, however they differ in that C#a will accept any number of arguments, and C#b won't. So just what should a Ruby method signature have? -- Rick DeNatale My blog on Ruby http://talklikeaduck.denhaven2.com/