Skip to content

Commit 74130fb

Browse files
committed
📖 Improve #idle and #idle_done rdoc
1 parent 6c59d03 commit 74130fb

File tree

1 file changed

+11
-3
lines changed

1 file changed

+11
-3
lines changed

lib/net/imap.rb

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2397,11 +2397,16 @@ def enable(*capabilities)
23972397
# checks the connection for each 60 seconds.
23982398
#
23992399
# loop do
2400-
# imap.idle(60) do |res|
2401-
# ...
2400+
# imap.idle(60) do |response|
2401+
# do_something_with(response)
2402+
# imap.idle_done if some_condition?(response)
24022403
# end
24032404
# end
24042405
#
2406+
# Returns the server's response to indicate the IDLE state has ended.
2407+
# Returns +nil+ if the server does not respond to #idle_done within
2408+
# idle_response_timeout seconds.
2409+
#
24052410
# Related: #idle_done, #noop, #check
24062411
#
24072412
# ===== Capabilities
@@ -2437,7 +2442,10 @@ def idle(timeout = nil, &response_handler)
24372442
return response
24382443
end
24392444

2440-
# Leaves IDLE.
2445+
# Leaves IDLE, allowing #idle to return.
2446+
#
2447+
# If the server does not respond within idle_response_timeout, #idle will
2448+
# return +nil+.
24412449
#
24422450
# Related: #idle
24432451
def idle_done

0 commit comments

Comments
 (0)