@@ -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
@@ -2174,10 +2177,13 @@ def uid_expunge(uid_set)
2174
2177
# result = imap.search(["SUBJECT", "hi there", "not", "new"])
2175
2178
# #=> Net::IMAP::SearchResult[1, 6, 7, 8, modseq: 5594]
2176
2179
# result.modseq # => 5594
2177
- def search ( keys , charset = nil )
2178
- return search_internal ( "SEARCH" , keys , charset )
2180
+ def search ( ... )
2181
+ search_internal ( "SEARCH" , ... )
2179
2182
end
2180
2183
2184
+ # :call-seq:
2185
+ # uid_search(criteria, charset = nil) -> result
2186
+ #
2181
2187
# Sends a {UID SEARCH command [IMAP4rev1 §6.4.8]}[https://www.rfc-editor.org/rfc/rfc3501#section-6.4.8]
2182
2188
# to search the mailbox for messages that match the given searching
2183
2189
# criteria, and returns unique identifiers (<tt>UID</tt>s).
@@ -2187,8 +2193,8 @@ def search(keys, charset = nil)
2187
2193
# capability has been enabled.
2188
2194
#
2189
2195
# See #search for documentation of parameters.
2190
- def uid_search ( keys , charset = nil )
2191
- return search_internal ( "UID SEARCH" , keys , charset )
2196
+ def uid_search ( ... )
2197
+ search_internal ( "UID SEARCH" , ... )
2192
2198
end
2193
2199
2194
2200
# :call-seq:
@@ -3117,7 +3123,7 @@ def enforce_logindisabled?
3117
3123
end
3118
3124
end
3119
3125
3120
- def search_internal ( cmd , keys , charset )
3126
+ def search_internal ( cmd , keys , charset = nil )
3121
3127
keys = normalize_searching_criteria ( keys )
3122
3128
args = charset ? [ "CHARSET" , charset , *keys ] : keys
3123
3129
synchronize do
0 commit comments