Module: FatCore::Range::ClassMethods
- Included in:
- Range
- Defined in:
- lib/fat_core/range.rb
Sorting collapse
-
#overlaps_among?(ranges) ⇒ Boolean
Return whether any of the
rangesoverlap one another.
Instance Method Details
#overlaps_among?(ranges) ⇒ Boolean
Return whether any of the ranges overlap one another
446 447 448 449 450 451 452 453 454 455 456 457 |
# File 'lib/fat_core/range.rb', line 446 def overlaps_among?(ranges) result = false unless ranges.empty? ranges.each do |r1| result = ranges.any? do |r2| r1.object_id != r2.object_id && r1.overlaps?(r2) end return true if result end end result end |