How to check if number is in x..y?

Hi all

I'm still quite new to Ruby, and I wonder what's the easiest way to check if a number is in the range x..y?


Is 10 in the range 5..123?

Thanks for help, Josh

nums = 5..123

if nums.include?(10)

puts "yes"


nums === 10 does the same.

range === val returns true if range.start <= val <= range.end