If I have two ranges that overlap:
x = 1..10 y = 5..15
When I say:
puts x.include? y
the output is:
If you're using Ruby 2.6, you can use Range#cover? with another Range.
Range
(1..5).cover?(2..3) #=> true (1..5).cover?(0..6) #=> false (1..5).cover?(1...6) #=> true