Module: Mutant::Range Private

Defined in:
lib/mutant/range.rb

This module is part of a private API. You should avoid using this module if possible, as it may be removed or be changed in the future.

Class Method Summary collapse

Class Method Details

.overlap?(left, right) ⇒ Boolean

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Test if two ranges overlap

Parameters:

Returns:

  • (Boolean)


11
12
13
# File 'lib/mutant/range.rb', line 11

def self.overlap?(left, right)
  left.end >= right.begin && right.end >= left.begin
end