Sha256: 035fe6ba4d4e3e4ee514d7468bde9ad7ee71764ccf3e26e60e5a654d92f8de16
Contents?: true
Size: 292 Bytes
Versions: 33
Compression:
Stored size: 292 Bytes
Contents
# frozen_string_literal: true class Range # Compare two ranges and see if they overlap each other # (1..5).overlaps?(4..6) # => true # (1..5).overlaps?(7..9) # => false def overlaps?(other) other.begin == self.begin || cover?(other.begin) || other.cover?(self.begin) end end
Version data entries
33 entries across 32 versions & 8 rubygems