Skip to content

Commit 2746d34

Browse files
authored
🔀 Merge pull request #252 from nevans/sequence-set-overlap
✨ Add `SequenceSet#overlap?` alias for `intersect?`
2 parents 2e65f2a + 86c0ddb commit 2746d34

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

‎lib/net/imap/sequence_set.rb

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@ class IMAP
151151
# +nil+ if the object cannot be converted to a compatible type.
152152
# - #cover? (aliased as #===):
153153
# Returns whether a given object is fully contained within +self+.
154-
# - #intersect?:
154+
# - #intersect? (aliased as #overlap?):
155155
# Returns whether +self+ and a given object have any common elements.
156156
# - #disjoint?:
157157
# Returns whether +self+ and a given object have no common elements.
@@ -502,6 +502,7 @@ def include_star?; @tuples.last&.last == STAR_INT end
502502
def intersect?(other)
503503
valid? && input_to_tuples(other).any? { intersect_tuple? _1 }
504504
end
505+
alias overlap? intersect?
505506

506507
# Returns +true+ if the set and a given object have no common elements,
507508
# +false+ otherwise.

0 commit comments

Comments
 (0)