Is there a Ruby shortcut for the following?
if (x > 2) and (x < 10)
do_something_here
end
I thought I saw something to that effect, but cannot find a reference to it. Of course it’s hard to lookup when you don’t know what operator you’re looking for.
As a sidenote, you can also use the triple equals operator for ranges:
This lets you use them in case statements as well: