@@ -101,38 +101,48 @@ class TaggedResponse < Struct.new(:tag, :name, :data, :raw_data)
101
101
end
102
102
103
103
# Net::IMAP::ResponseText represents texts of responses.
104
- # The text may be prefixed by the response code.
105
104
#
106
- # resp_text ::= ["[" resp-text-code "]" SP] text
107
- #
108
- # ==== Fields:
109
- #
110
- # code:: Returns the response code. See ((<Net::IMAP::ResponseCode>)).
111
- #
112
- # text:: Returns the text.
105
+ # The text may be prefixed by a ResponseCode.
113
106
#
107
+ # ResponseText is returned from TaggedResponse#data, or from
108
+ # UntaggedResponse#data when the response type is a "condition" ("OK", "NO",
109
+ # "BAD", "PREAUTH", or "BYE").
114
110
class ResponseText < Struct . new ( :code , :text )
111
+ ##
112
+ # method: code
113
+ # :call-seq: code -> ResponseCode or nil
114
+ #
115
+ # Returns a ResponseCode, if the response contains one
116
+
117
+ ##
118
+ # method: text
119
+ # :call-seq: text -> string
120
+ #
121
+ # Returns the response text, not including any response code
115
122
end
116
123
117
- # Net::IMAP::ResponseCode represents response codes.
118
- #
119
- # resp_text_code ::= "ALERT" /
120
- # "BADCHARSET" [SP "(" astring *(SP astring) ")" ] /
121
- # capability_data / "PARSE" /
122
- # "PERMANENTFLAGS" SP "("
123
- # [flag_perm *(SP flag_perm)] ")" /
124
- # "READ-ONLY" / "READ-WRITE" / "TRYCREATE" /
125
- # "UIDNEXT" SP nz_number / "UIDVALIDITY" SP nz_number /
126
- # "UNSEEN" SP nz_number /
127
- # atom [SP 1*<any TEXT-CHAR except "]">]
128
- #
129
- # ==== Fields:
130
- #
131
- # name:: Returns the name, such as "ALERT", "PERMANENTFLAGS", or "UIDVALIDITY".
124
+ # Net::IMAP::ResponseCode represents response codes. Response codes can be
125
+ # retrieved from ResponseText#code and can be included in any "condition"
126
+ # response: any TaggedResponse and UntaggedResponse when the response type
127
+ # is a "condition" ("OK", "NO", "BAD", "PREAUTH", or "BYE").
132
128
#
133
- # data:: Returns the data, if it exists.
134
129
#
135
130
class ResponseCode < Struct . new ( :name , :data )
131
+ ##
132
+ # method: name
133
+ # :call-seq: name -> string
134
+ #
135
+ # Returns the response code name, such as "ALERT", "PERMANENTFLAGS", or
136
+ # "UIDVALIDITY".
137
+
138
+ ##
139
+ # method: data
140
+ # :call-seq: data -> object or nil
141
+ #
142
+ # Returns the parsed response code data, e.g: an array of capabilities
143
+ # strings, an array of character set strings, a list of permanent flags,
144
+ # an Integer, etc. The response #code determines what form the response
145
+ # code data can take.
136
146
end
137
147
138
148
# Net::IMAP::UIDPlusData represents the ResponseCode#data that accompanies
0 commit comments