If I have two ranges that overlap:
x = 1..10
y = 5..15
When I say:
puts x.include? y
the output is:
false
because the two ranges only overlap partially.
But if I want it to be "true" when there is partial overlap between two ranges, how would I write that? In other words I need a way to know when one range contains a subset of another range. I assume there's an elegant way to write this in Ruby but the only solutions I can think of are verbose.