aboutsummaryrefslogtreecommitdiffstats
path: root/lib/range_ext.rb
diff options
context:
space:
mode:
authorRobert2017-05-02 22:10:31 +0200
committerRobert2017-05-02 22:10:31 +0200
commite89703a1646711ea2387e6058765aa3c6b953971 (patch)
tree77a2fb1bc960587e17bb48409b89ee4d5b0d4f88 /lib/range_ext.rb
parentcd8b08325558f6339e953b69fa64fa58a90bf3f2 (diff)
downloadchouette-core-e89703a1646711ea2387e6058765aa3c6b953971.tar.bz2
more duplicates of Range#intersection removed and range_ext required instead
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