From: Phillip Gawlowski Date: 2011-10-15T06:11:15+09:00 Subject: Re: What’s the best way of checking if an argument has been given or not? On Fri, Oct 14, 2011 at 5:31 PM, Jens Wille wrote: > luke gruber [2011-10-14 17:15]: >> That way, the instance won't be available across classes and you >> can just check if the argument responds_to :missing? > or you can just do this: > > class A > >  def b(c = d = true)  # or some other truthy value >    if d >      puts 'no argument was given' >    else >      puts c >    end >  end > > end The downside to this approach is that you use "true" to say something is "false". -- Phillip Gawlowski gplus.to/phgaw | twitter.com/phgaw A method of solution is perfect if we can forsee from the start, and even prove, that following that method we shall attain our aim.               -- Leibniz