method

overlaps?

v4.0.2 - Show latest stable - Class: Range
overlaps?(other)
public

Compare two ranges and see if they overlap each other

(1..5).overlaps?(4..6) # => true
(1..5).overlaps?(7..9) # => false

1Note

If you need to check for overlaps in Times, use the validates_overlap gem.

joshuapinter ยท May 3, 2018