Module: ActiveSupport::CoreExtensions::Range::Overlaps

Included in:
Range
Defined in:
lib/active_support/core_ext/range/overlaps.rb

Overview

Check if Ranges overlap.

Instance Method Summary collapse

Instance Method Details

#overlaps?(other) ⇒ Boolean

Returns:

  • (Boolean)


6
7
8
# File 'lib/active_support/core_ext/range/overlaps.rb', line 6

def overlaps?(other)
  include?(other.first) || other.include?(first)
end