Range.new( start, end, exclusive=false ) ->
aRange
Constructs a range using the given start and end. If the third parameter is
omitted or is false, the range will include the end object; otherwise, it
will be excluded.
rng === anObject -> true or false
Returns true if anObject is an element of rng, false otherwise.
Conveniently, === is the comparison operator used by case statements.
case 79
when 1..50 then print "low\n"
when 51..75 then print "medium\n"
when 76..100 then print "high\n"
end
produces:
high
rng.begin/rng.first -> anObject
Returns the first object in the range.
rng.last/rng.end -> anObject
Return the last object in range.
rng.begin/rng.first -> anObject
Returns the first object in the range.
rng.last/rng.end -> anObject
Return the last object in range.
rng.exclude_end? -> true or false
Returns true if rng excludes its end value.
rng.length/rng.size -> anInteger
Returns the number of objects in rng.
(1..10).length #=> 10
(1...10).length #=> 9
rng.length/rng.size -> anInteger
Returns the number of objects in rng.
(1..10).length #=> 10
(1...10).length #=> 9