Created
December 5, 2012 00:58
-
-
Save davetapley/4210878 to your computer and use it in GitHub Desktop.
Extending Range with overlaps?
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Range | |
def overlaps?(other) | |
(self.first <= other.last) and (other.first <= self.last) | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment