I'm trying to find out if there's a cleaner way to write something like this:
if var1 == "hi" || var1 == "bye" || var1 == "well" || var1 == "hello"
puts var1
end
Basically, there's one variable and I want to find out if it's equal to one of several possible values.
I tried the following but it was invalid:
if var1 == ("hi" || "bye" || "well" || "hello")
puts var1
end