On Oct 15, 9:47 am, "Robert Dober" <robert.do... / gmail.com> wrote:

> > I suppose I find it more difficult to imagine a use case for nil.to_i
> > returning a no method error or throwing an exception.
>
> unless you did not intent it to be nil, that had escaped me too.

That what tests are for. (Of course one could say that about anything,
but in this case I think it's the better choice.)

And of course there's always:

  raise if x.nil?

T.