Skip to content

Commit a8932f6

Browse files
committed
📚🐛 Fix doc & error msg for SequenceSet coersion
1 parent 9687ddb commit a8932f6

File tree

1 file changed

+8
-10
lines changed

1 file changed

+8
-10
lines changed

lib/net/imap/sequence_set.rb

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -392,8 +392,8 @@ def clear
392392
# Replace the contents of the set with the contents of +other+ and returns
393393
# +self+.
394394
#
395-
# +other+ may be another SequenceSet, or it may be an IMAP +sequence-set+
396-
# string, a number, a range, <tt>*</tt>, or an enumerable of these.
395+
# +other+ may be another SequenceSet or any other object that would be
396+
# accepted by ::new.
397397
def replace(other)
398398
case other
399399
when SequenceSet then initialize_dup(other)
@@ -509,8 +509,9 @@ def hash; [self.class, string].hash end
509509

510510
# :call-seq: self === other -> true | false | nil
511511
#
512-
# Returns whether +other+ is contained within the set. Returns +nil+ if a
513-
# StandardError is raised while converting +other+ to a comparable type.
512+
# Returns whether +other+ is contained within the set. +other+ may be any
513+
# object that would be accepted by ::new. Returns +nil+ if StandardError
514+
# is raised while converting +other+ to a comparable type.
514515
#
515516
# Related: #cover?, #include?, #include_star?
516517
def ===(other)
@@ -929,9 +930,7 @@ def merge(*sets)
929930
# Removes all of the elements that appear in any of the given +sets+ from
930931
# the set, and returns +self+.
931932
#
932-
# The +sets+ may be any objects that would be accepted by ::new: non-zero
933-
# 32 bit unsigned integers, ranges, <tt>sequence-set</tt> formatted
934-
# strings, other sequence sets, or enumerables containing any of these.
933+
# The +sets+ may be any objects that would be accepted by ::new.
935934
#
936935
# Related: #difference
937936
def subtract(*sets)
@@ -1573,9 +1572,8 @@ def input_to_tuples(set)
15731572
when Array then set.flat_map { input_to_tuples _1 }
15741573
when nil then []
15751574
else
1576-
raise DataFormatError,
1577-
"expected nz-number, range, string, or enumerable; " \
1578-
"got %p" % [set]
1575+
raise DataFormatError, "expected nz-number, range, '*', Set, Array; " \
1576+
"got %p" % [set]
15791577
end
15801578
end
15811579

0 commit comments

Comments
 (0)