Method: FatCore::Range#overlaps?

Defined in:
lib/fat_core/range.rb

#overlaps?(other) ⇒ Boolean

Return whether self overlaps with other Range.

Parameters:

  • other (Range)

    range to test for overlap with self

Returns:

  • (Boolean)

    is there an overlap?


309
310
311
312
# File 'lib/fat_core/range.rb', line 309

def overlaps?(other)
  (cover?(other.min) || cover?(other.max) ||
   other.cover?(min) || other.cover?(max))
end