class Range
def overlaps?(other)
(1..5).overlaps?(4..6) # => true
Compare two ranges and see if they overlap each other
def overlaps?(other) cover?(other.first) || other.cover?(first) end
def overlaps?(other) cover?(other.first) || other.cover?(first) end