Reject elements from a set
require 'set' primes = Set[2, 3, 5, 7] # set of prime numbers primes.reject! {|x| x%2==1} # => nil: unchanged