Ranges

  • Stored using the Range class
  • Ranges are used to internally to implement sequences, conditions, and intervals
myRange.min
myRange.max

myRange.include?(expr) # returns true if expr is in the range; otherwise, returns false
myRange.reject {|x| reject-expr } # returns the range minus any elements satisfied by reject-expr

myRange.length

Sequences

expr..expr     inclusive range
expr...expr range excluding the last element

Intervals

case expr
when <interval> # If expr is in the interval
....
end