Skip to content

Commit db83bec

Browse files
committed
📚 Update SequenceSet "What's Here?" index
This splits off "normalized" vs "order preserving" methods in the "What's here?" sections.
1 parent 4cabe29 commit db83bec

File tree

1 file changed

+19
-6
lines changed

1 file changed

+19
-6
lines changed

lib/net/imap/sequence_set.rb

Lines changed: 19 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -200,14 +200,11 @@ class IMAP
200200
#
201201
# === Methods for Iterating
202202
#
203+
# <i>Normalized (sorted and coalesced):</i>
203204
# - #each_element: Yields each number and range in the set, sorted and
204205
# coalesced, and returns +self+.
205206
# - #elements (aliased as #to_a): Returns an Array of every number and range
206207
# in the set, sorted and coalesced.
207-
# - #each_entry: Yields each number and range in the set, unsorted and
208-
# without deduplicating numbers or coalescing ranges, and returns +self+.
209-
# - #entries: Returns an Array of every number and range in the set,
210-
# unsorted and without deduplicating numbers or coalescing ranges.
211208
# - #each_range:
212209
# Yields each element in the set as a Range and returns +self+.
213210
# - #ranges: Returns an Array of every element in the set, converting
@@ -217,6 +214,12 @@ class IMAP
217214
# ranges into all of their contained numbers.
218215
# - #to_set: Returns a Set containing all of the #numbers in the set.
219216
#
217+
# <i>Order preserving:</i>
218+
# - #each_entry: Yields each number and range in the set, unsorted and
219+
# without deduplicating numbers or coalescing ranges, and returns +self+.
220+
# - #entries: Returns an Array of every number and range in the set,
221+
# unsorted and without deduplicating numbers or coalescing ranges.
222+
#
220223
# === Methods for \Set Operations
221224
# These methods do not modify +self+.
222225
#
@@ -236,19 +239,29 @@ class IMAP
236239
# === Methods for Assigning
237240
# These methods add or replace elements in +self+.
238241
#
242+
# <i>Normalized (sorted and coalesced):</i>
243+
#
244+
# These methods always update #string to be fully sorted and coalesced.
245+
#
239246
# - #add (aliased as #<<): Adds a given object to the set; returns +self+.
240247
# - #add?: If the given object is not an element in the set, adds it and
241248
# returns +self+; otherwise, returns +nil+.
242249
# - #merge: Merges multiple elements into the set; returns +self+.
250+
# - #complement!: Replaces the contents of the set with its own #complement.
251+
#
252+
# <i>Order preserving:</i>
253+
#
254+
# These methods _may_ cause #string to not be sorted or coalesced.
255+
#
243256
# - #append: Adds a given object to the set, appending it to the existing
244257
# string, and returns +self+.
245258
# - #string=: Assigns a new #string value and replaces #elements to match.
246259
# - #replace: Replaces the contents of the set with the contents
247260
# of a given object.
248-
# - #complement!: Replaces the contents of the set with its own #complement.
249261
#
250262
# === Methods for Deleting
251-
# These methods remove elements from +self+.
263+
# These methods remove elements from +self+, and update #string to be fully
264+
# sorted and coalesced.
252265
#
253266
# - #clear: Removes all elements in the set; returns +self+.
254267
# - #delete: Removes a given object from the set; returns +self+.

0 commit comments

Comments
 (0)