Is it in a set
require 'set' s = Set.new(1..3) # => #<Set: {1, 2, 3}> p s.include? 1 # => true p s.member? 0 # => false: member? is a synonym