diff --git a/lib/net/imap/esearch_result.rb b/lib/net/imap/esearch_result.rb index f0c25695..68c94ec5 100644 --- a/lib/net/imap/esearch_result.rb +++ b/lib/net/imap/esearch_result.rb @@ -25,6 +25,12 @@ class IMAP # Some search extensions may result in the server sending ESearchResult # responses after the initiating command has completed. Use # IMAP#add_response_handler to handle these responses. + # + # ==== Compatibility with SearchResult + # + # Note that both SearchResult and ESearchResult implement +each+, +to_a+, + # and +to_sequence_set+. These methods can be used regardless of whether + # the server returns +SEARCH+ or +ESEARCH+ data (or no data). class ESearchResult < Data.define(:tag, :uid, :data) def initialize(tag: nil, uid: nil, data: nil) tag => String | nil; tag = -tag if tag diff --git a/lib/net/imap/search_result.rb b/lib/net/imap/search_result.rb index 31f127b3..80cb62de 100644 --- a/lib/net/imap/search_result.rb +++ b/lib/net/imap/search_result.rb @@ -7,6 +7,12 @@ class IMAP # identifiers returned by Net::IMAP#uid_search. # # For backward compatibility, SearchResult inherits from Array. + # + # ==== Compatibility with ESearchResult + # + # Note that both SearchResult and ESearchResult implement +each+, +to_a+, + # and +to_sequence_set+. These methods can be used regardless of whether + # the server returns +SEARCH+ or +ESEARCH+ data (or no data). class SearchResult < Array # Returns a SearchResult populated with the given +seq_nums+.