Skip to content

Instantly share code, notes, and snippets.

@timbuchwaldt
Created June 29, 2012 08:27
Show Gist options
  • Save timbuchwaldt/3016654 to your computer and use it in GitHub Desktop.
Save timbuchwaldt/3016654 to your computer and use it in GitHub Desktop.
Timerange comparison
class Range
def intersecting? t2
if self.end <= t2.begin or self.begin >= t2.end
return false
else
return true
end
end
end
# Usage: compare 2 Ranges (Time.at(0)..Time.at(100))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment