@@ -1929,6 +1929,9 @@ def uid_expunge(uid_set)
1929
1929
end
1930
1930
end
1931
1931
1932
+ # :call-seq:
1933
+ # search(criteria, charset = nil) -> result
1934
+ #
1932
1935
# Sends a {SEARCH command [IMAP4rev1 §6.4.4]}[https://www.rfc-editor.org/rfc/rfc3501#section-6.4.4]
1933
1936
# to search the mailbox for messages that match the given search +criteria+,
1934
1937
# and returns a SearchResult. SearchResult inherits from Array (for
@@ -2020,10 +2023,13 @@ def uid_expunge(uid_set)
2020
2023
# result = imap.search(["SUBJECT", "hi there", "not", "new"])
2021
2024
# #=> Net::IMAP::SearchResult[1, 6, 7, 8, modseq: 5594]
2022
2025
# result.modseq # => 5594
2023
- def search ( keys , charset = nil )
2024
- return search_internal ( "SEARCH" , keys , charset )
2026
+ def search ( ... )
2027
+ search_internal ( "SEARCH" , ... )
2025
2028
end
2026
2029
2030
+ # :call-seq:
2031
+ # uid_search(criteria, charset = nil) -> result
2032
+ #
2027
2033
# Sends a {UID SEARCH command [IMAP4rev1 §6.4.8]}[https://www.rfc-editor.org/rfc/rfc3501#section-6.4.8]
2028
2034
# to search the mailbox for messages that match the given searching
2029
2035
# criteria, and returns unique identifiers (<tt>UID</tt>s).
@@ -2033,8 +2039,8 @@ def search(keys, charset = nil)
2033
2039
# capability has been enabled.
2034
2040
#
2035
2041
# See #search for documentation of parameters.
2036
- def uid_search ( keys , charset = nil )
2037
- return search_internal ( "UID SEARCH" , keys , charset )
2042
+ def uid_search ( ... )
2043
+ search_internal ( "UID SEARCH" , ... )
2038
2044
end
2039
2045
2040
2046
# :call-seq:
@@ -2963,7 +2969,7 @@ def enforce_logindisabled?
2963
2969
end
2964
2970
end
2965
2971
2966
- def search_internal ( cmd , keys , charset )
2972
+ def search_internal ( cmd , keys , charset = nil )
2967
2973
keys = normalize_searching_criteria ( keys )
2968
2974
args = charset ? [ "CHARSET" , charset , *keys ] : keys
2969
2975
synchronize do
0 commit comments