<Toplevel Module>
ActiveSupport
—
#1
1 module ActiveSupport #:nodoc: 2 module CoreExtensions #:nodoc: 3 module Range #:nodoc: 4 # Check if Ranges overlap. 5 module Overlaps 6 # Compare two ranges and see if they overlap eachother 7 # (1..5).overlaps?(4..6) # => true 8 # (1..5).overlaps?(7..9) # => false 9 def overlaps?(other) 10 include?(other.first) || other.include?(first) 11 end 12 end 13 end 14 end 15 end