method

include?

v1_8_7_72 - Show latest stable - Class: Range
include?(p1)
public

Returns true if obj 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