Luke Worth <luke / worth.id.au> wrote:

>>    $ ruby -e "puts(('a'..'z').include?(1))"
>>    -e:1:in `include?': undefined method `>' for false:FalseClass
>> (NoMethodError)

> I think this has something to do with the implementation of
> Range#include? (being that it returns rng.start <= val <= rng.end)

But I think Range#include? should catch the Exception and return false  
instead.

> An easy way around it is to use ('a'..'z').entries.include?(1) instead

That does not work when Range#start is a Float (and it builds an  
additional Array)

-Levin