Recently I’ve written this little snippet:
puts "yay" if [1, 2, 3].each {|i| break unless (1..9).to_a.include?(i)} # => "yay" puts "nope" unless [1, 2, 3, 'A'].each {|i| break unless (1..9).to_a.include?(i)} # => "nope"