Skip to content

Commit 3e9ee5a

Browse files
committed
📚 Document SequenceSet normalized form
1 parent db3809c commit 3e9ee5a

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

lib/net/imap/sequence_set.rb

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,21 @@ class IMAP
6060
# set = Net::IMAP::SequenceSet[1, 2, [3..7, 5], 6..10, 2048, 1024]
6161
# set.valid_string #=> "1:10,55,1024:2048"
6262
#
63+
# == Normalized form
64+
#
65+
# When a sequence set is created with a single String value, that #string
66+
# representation is preserved. SequenceSet's internal representation
67+
# implicitly sorts all entries, de-duplicates numbers, and coalesces
68+
# adjacent or overlapping ranges. Most enumeration methods and offset-based
69+
# methods use this normalized representation. Most modification methods
70+
# will convert #string to its normalized form.
71+
#
72+
# In some cases the order of the string representation is significant, such
73+
# as the +ESORT+, <tt>CONTEXT=SORT</tt>, and +UIDPLUS+ extensions. Use
74+
# #entries or #each_entry to enumerate the set in its original order. To
75+
# preserve #string order while modifying a set, use #append, #string=, or
76+
# #replace.
77+
#
6378
# == Using <tt>*</tt>
6479
#
6580
# \IMAP sequence sets may contain a special value <tt>"*"</tt>, which

0 commit comments

Comments
 (0)