Q:

Ruby: Is it possible to set an if statement == to 2 variables?

I am making a simple program that censors a users input based on the words chosen.
puts "Enter your Text: "
text = gets.chomp.downcase!

puts "Word to censor: "
censor1 = gets.chomp
censor1.downcase!

puts "Second word to censor: "
censor2 = gets.chomp
censor2.downcase!

words = text.split(" ")
words.each do |letter|
  if letter == censor1
    print "CENSORED "
  else
    print words + " "
  end
end

So, is it possible to set: 'if letter == censor1 and censor 2' ?

A:

You can check if object present in array with the help of Array#include?
if [censor1, censor2].include?(letter)

A bit simplified variant of your code:
puts 'Enter your Text: '
text = gets.chomp.downcase
puts 'Word to censor: '
censor1 = gets.chomp.downcase
puts 'Second word to censor: '
censor2 = gets.chomp.downcase

text.split(' ').each do |word|
  if [censor1, censor2].include?(word)
    print 'CENSORED '                                                                                                                                                                  
  else
    print word + ' '
  end
end

And much easier and better solution with String#gsub which replaces all occurrences of censored words in text:
puts 'Enter your Text: '
text = gets.chomp.downcase 
puts 'Word to censor: '
censor1 = gets.chomp.downcase
puts 'Second word to censor: '
censor2 = gets.chomp.downcase

[censor1, censor2].each { |c| text.gsub!(c, 'CENSORED') }
puts text

