Is there a ruby idiom for something like:
a==b || a==c
I thought the following should have worked but it doesn’t
a == b||c
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Sometimes I’ve been known to use
Array#include?to check for equality against a long list of values.But for 2 values, usually the
a == 1 || a == 2is easier and simpler.