Skip to content

Commit 24bec60

Browse files
committed
Improved rdoc comments
1 parent e1e59d0 commit 24bec60

File tree

1 file changed

+36
-17
lines changed

1 file changed

+36
-17
lines changed

lib/net/imap.rb

Lines changed: 36 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -435,19 +435,20 @@ def login(user, password)
435435
# in the +mailbox+ can be accessed.
436436
#
437437
# After you have selected a mailbox, you may retrieve the
438-
# number of items in that mailbox from +@responses["EXISTS"][-1]+,
439-
# and the number of recent messages from +@responses["RECENT"][-1]+.
438+
# number of items in that mailbox from <code>@responses["EXISTS"][-1]</code>,
439+
# and the number of recent messages from <code>@responses["RECENT"][-1]</code>.
440440
# Note that these values can change if new messages arrive
441441
# during a session; see #add_response_handler for a way of
442442
# detecting this event.
443443
#
444444
# A Net::IMAP::NoResponseError is raised if the mailbox does not
445445
# exist or is for some reason non-selectable.
446446
#
447-
# If the server supports the UIDPLUS extension it may return an additional
448-
# "NO" response with a "UIDNOTSTICKY" response code indicating that the
449-
# mailstore does not support persistent UIDs:
450-
# +@responses["NO"].last.code.name == "UIDNOTSTICKY"+
447+
# If the server supports the [UIDPLUS[https://www.rfc-editor.org/rfc/rfc4315.html]]
448+
# extension it may return an additional "NO" response with a "UIDNOTSTICKY" response code
449+
# indicating that the mailstore does not support persistent UIDs
450+
# [1[https://www.rfc-editor.org/rfc/rfc4315.html#page-4]]:
451+
# @responses["NO"].last.code.name == "UIDNOTSTICKY"
451452
def select(mailbox)
452453
synchronize do
453454
@responses.clear
@@ -758,8 +759,9 @@ def status(mailbox, attr)
758759
# not exist (it is not created automatically), or if the flags,
759760
# date_time, or message arguments contain errors.
760761
#
761-
# If the server supports the UIDPLUS extension it returns an array
762-
# with the UIDVALIDITY and the assigned UID of the appended message.
762+
# If the server supports the [UIDPLUS[https://www.rfc-editor.org/rfc/rfc4315.html]]
763+
# extension it returns an array with the UIDVALIDITY and the assigned UID of the
764+
# appended message.
763765
def append(mailbox, message, flags = nil, date_time = nil)
764766
args = []
765767
if flags
@@ -800,10 +802,27 @@ def expunge
800802
end
801803

802804
# Similar to #expunge, but takes a set of unique identifiers as
803-
# argument.
804-
def uid_expunge(set)
805+
# argument. Sends a UID EXPUNGE command to permanently remove all
806+
# messages that have both the \\Deleted flag set and a UID that is
807+
# included in +uid_set+.
808+
#
809+
# By using UID EXPUNGE instead of EXPUNGE when resynchronizing with
810+
# the server, the client can ensure that it does not inadvertantly
811+
# remove any messages that have been marked as \\Deleted by other
812+
# clients between the time that the client was last connected and
813+
# the time the client resynchronizes.
814+
#
815+
# Note:: Although the command takes a +uid_set+ for its argument, the
816+
# server still returns regular EXPUNGE responses, which contain
817+
# a <em>sequence number</em>. These will be deleted from
818+
# #responses and this method returns them as an array of
819+
# <em>sequence number</em> integers.
820+
#
821+
# ==== Required capability
822+
# +UIDPLUS+ - described in [UIDPLUS[https://www.rfc-editor.org/rfc/rfc4315.html]].
823+
def uid_expunge(uid_set)
805824
synchronize do
806-
send_command("UID EXPUNGE", MessageSet.new(set))
825+
send_command("UID EXPUNGE", MessageSet.new(uid_set))
807826
return @responses.delete("EXPUNGE")
808827
end
809828
end
@@ -929,9 +948,9 @@ def uid_store(set, attr, flags)
929948
# a number, an array of numbers, or a Range object. The number is
930949
# a message sequence number.
931950
#
932-
# If the server supports the UIDPLUS extension it returns an array with
933-
# the UIDVALIDITY, the UID set of the source messages and the assigned
934-
# UID set of the copied messages.
951+
# If the server supports the [UIDPLUS[https://www.rfc-editor.org/rfc/rfc4315.html]]
952+
# extension it returns an array with the UIDVALIDITY, the UID set of the source messages
953+
# and the assigned UID set of the copied messages.
935954
def copy(set, mailbox)
936955
copy_internal("COPY", set, mailbox)
937956
end
@@ -948,9 +967,9 @@ def uid_copy(set, mailbox)
948967
#
949968
# The MOVE extension is described in [EXT-MOVE[https://tools.ietf.org/html/rfc6851]].
950969
#
951-
# If the server supports the UIDPLUS extension it returns an array with
952-
# the UIDVALIDITY, the UID set of the source messages and the assigned
953-
# UID set of the moved messages.
970+
# If the server supports the [UIDPLUS[https://www.rfc-editor.org/rfc/rfc4315.html]]
971+
# extension it returns an array with the UIDVALIDITY, the UID set of the source messages
972+
# and the assigned UID set of the moved messages.
954973
def move(set, mailbox)
955974
copy_internal("MOVE", set, mailbox)
956975
end

0 commit comments

Comments
 (0)