Sha256: 32f3da5b77870c8007dcf8893e00ce5adbab12130bb1f21a567cb25a459d6549
Contents?: true
Size: 258 Bytes
Versions: 156
Compression:
Stored size: 258 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) cover?(other.first) || other.cover?(first) end end
Version data entries
156 entries across 145 versions & 17 rubygems