From: Charles Oliver Nutter Date: 2009-08-20T05:58:12+09:00 Subject: Re: #has_arguments? On Wed, Aug 19, 2009 at 3:40 PM, Chris Shea wrote: > Here's a little trick I learned (very hacky): > >  def meth(a=(no_argument='default')) >    if no_argument >      'nothing given' >    else >      "we got #{a.inspect}" >    end >  end > > Your default argument can't be falsy (but you could use something > truey and use your falsy value in its place).  Anyway: Yeah, my version avoids the falsy issue...but yours is shorter. Either way...works fine in JRuby and 1.9. - Charlie