Skip to content

Commit aacc2ac

Browse files
committed
🚧 Add ExtensionData for unhandled extensions
Although this is currently unused, it should eventually be used for `StatusData`, `BodyStructure`, `ESEARCH`, `MailboxList`, etc.
1 parent 5212a0b commit aacc2ac

File tree

1 file changed

+19
-2
lines changed

1 file changed

+19
-2
lines changed

lib/net/imap/response_data.rb

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ class IgnoredResponse < UntaggedResponse
7272
# unknown extensions to response types without a well-defined extension
7373
# grammar.
7474
#
75-
# See also: UnparsedNumericResponseData
75+
# See also: UnparsedNumericResponseData, ExtensionData, IgnoredResponse
7676
class UnparsedData < Struct.new(:unparsed_data)
7777
##
7878
# method: unparsed_data
@@ -88,7 +88,7 @@ class UnparsedData < Struct.new(:unparsed_data)
8888
# Net::IMAP::UnparsedNumericResponseData represents data for unhandled
8989
# response types with a numeric prefix. See the documentation for #number.
9090
#
91-
# See also: UnparsedData
91+
# See also: UnparsedData, ExtensionData, IgnoredResponse
9292
class UnparsedNumericResponseData < Struct.new(:number, :unparsed_data)
9393
##
9494
# method: number
@@ -107,6 +107,23 @@ class UnparsedNumericResponseData < Struct.new(:number, :unparsed_data)
107107
# The unparsed data, not including #number or UntaggedResponse#name.
108108
end
109109

110+
# **Note:** This represents an intentionally _unstable_ API. Where
111+
# instances of this class are returned, future releases may return a
112+
# different (incompatible) object <em>without deprecation or warning</em>.
113+
#
114+
# Net::IMAP::ExtensionData represents data that is parsable according to the
115+
# forward-compatible extension syntax in RFC3501, RFC4466, or RFC9051, but
116+
# isn't directly known or understood by Net::IMAP yet.
117+
#
118+
# See also: UnparsedData, UnparsedNumericResponseData, IgnoredResponse
119+
class ExtensionData < Struct.new(:data)
120+
##
121+
# method: data
122+
# :call-seq: data -> string
123+
#
124+
# The parsed extension data.
125+
end
126+
110127
# Net::IMAP::TaggedResponse represents tagged responses.
111128
#
112129
# The server completion result response indicates the success or

0 commit comments

Comments
 (0)