aboutsummaryrefslogtreecommitdiffstats
path: root/lib/range_ext.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/range_ext.rb')
-rw-r--r--lib/range_ext.rb1
1 files changed, 1 insertions, 0 deletions
diff --git a/lib/range_ext.rb b/lib/range_ext.rb
index 729cd1092..f1df5e70d 100644
--- a/lib/range_ext.rb
+++ b/lib/range_ext.rb
@@ -1,4 +1,5 @@
class Range
+
def intersection(other)
return nil if (self.max < other.min or other.max < self.min)
[self.min, other.min].max..[self.max, other.max].min