I'm trying to get the ==
operator to match two possible values like so.
def demo(x)
puts "foo!" if x == (5 || 7)
end
demo(5)
#=> "foo!"
demo(7)
#=> nil
So this doesn't work, but is there a way to match multiple values at the end of a ==
operator in ruby? I think I've seen it done before, so that's why I tried it, but I'm not sure about that.