Skip to content
This repository
branch: master
Fetching contributors…

Octocat-spinner-32-eaf2f5

Cannot retrieve contributors at this time

file 9 lines (8 sloc) 0.227 kb
1 2 3 4 5 6 7 8
class Range
  # Compare two ranges and see if they overlap each other
  # (1..5).overlaps?(4..6) # => true
  # (1..5).overlaps?(7..9) # => false
  def overlaps?(other)
    cover?(other.first) || other.cover?(first)
  end
end
Something went wrong with that request. Please try again.