diff options
Diffstat (limited to 'activesupport/lib/active_support/core_ext/range/overlaps.rb')
-rw-r--r-- | activesupport/lib/active_support/core_ext/range/overlaps.rb | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/activesupport/lib/active_support/core_ext/range/overlaps.rb b/activesupport/lib/active_support/core_ext/range/overlaps.rb new file mode 100644 index 0000000000..672e97fca4 --- /dev/null +++ b/activesupport/lib/active_support/core_ext/range/overlaps.rb @@ -0,0 +1,14 @@ +module ActiveSupport #:nodoc: + module CoreExtensions #:nodoc: + module Range #:nodoc: + # Check if Ranges overlap + module Overlaps + + def overlaps?(other) + include?(other.first) || other.include?(first) + end + + end + end + end +end
\ No newline at end of file |