1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323
|
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title>Class: RMail::Message</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<link rel=StyleSheet href="../.././rdoc-style.css" type="text/css" media="screen" />
<script type="text/javascript" language="JavaScript">
<!--
function popCode(url) {
window.open(url, "Code",
"resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
}
//-->
</script>
</head>
<body bgcolor="white">
<table summary="Information on class" width="100%" border="0" cellspacing="0">
<tr class="title-row">
<td class="big-title-font">
<sup><font color="aqua">Class</font></sup> RMail::Message
</td>
<td align="right">
<table summary="layout" cellspacing="0" cellpadding="2">
<tr valign="top">
<td class="small-title-font">In:</td>
<td class="small-title-font">
<a href="../../files/lib/rmail/message_rb.html" class="aqua">
lib/rmail/message.rb
</a>
<br />
</td>
</tr>
<tr>
<td class="small-title-font">Parent:</td>
<td class="small-title-font">
Object
</td>
</tr>
</table>
</td>
</tr>
</table>
<!-- banner header -->
<div class="description"><p>
The <a href="Message.html">RMail::Message</a> is an object representation
of a standard Internet email message, including MIME multipart messages.
</p>
<p>
An <a href="Message.html">RMail::Message</a> object represents a message
header (held in the contained <a href="Header.html">RMail::Header</a>
object) and a message body. The message body may either be a single String
for single part messages or an Array of <a
href="Message.html">RMail::Message</a> objects for MIME multipart messages.
</p>
</div>
<table summary="Methods" cellpadding="5" width="100%">
<tr><td class="tablesubtitle">Methods</td></tr>
</table>
<div class="name-list">
<a href="#M000011">==</a>
<a href="#M000016">add_part</a>
<a href="#M000012">body</a>
<a href="#M000013">body=</a>
<a href="#M000017">decode</a>
<a href="#M000021">each</a>
<a href="#M000020">each_part</a>
<a href="#M000014">header</a>
<a href="#M000015">multipart?</a>
<a href="#M000010">new</a>
<a href="#M000018">part</a>
<a href="#M000019">to_s</a>
</div>
<table summary="Attributes" cellpadding="5" width="100%">
<tr><td class="tablesubtitle">Attributes</td></tr>
</table>
<table summary="Attribute details" cellspacing="5">
<tr valign="top">
<td class="attr-name">epilogue</td>
<td align="center" class="attr-rw"> [RW] </td>
<td><p>
Access the epilogue string for this message. The epilogue string is
relevant only for multipart messages. It is the text that occurs after all
parts of the message and is generally nil.
</p>
</td>
</tr>
<tr valign="top">
<td class="attr-name">preamble</td>
<td align="center" class="attr-rw"> [RW] </td>
<td><p>
Access the preamble string for this message. The preamble string is
relevant only for multipart messages. It is the text that occurs just
before the first part of the message, and is generally nil or simple
English text describing the nature of the message.
</p>
</td>
</tr>
</table>
<table summary="Method list" cellpadding="5" width="100%">
<tr><td class="tablesubtitle">Public Class methods</td></tr>
</table>
<table summary="method" width="100%" cellspacing="0" cellpadding="5" border="0">
<tr><td class="methodtitle">
<a name="M000010"></a>
<a href="Message.src/M000010.html" target="Code" class="methodtitle"
onClick="popCode('Message.src/M000010.html');return false;">
<b>new</b>()
</a>
</td></tr>
</table>
<div class="description">
<p>
Create a new, empty, <a href="Message.html">RMail::Message</a>.
</p>
</div>
<table summary="Method list" cellpadding="5" width="100%">
<tr><td class="tablesubtitle">Public Instance methods</td></tr>
</table>
<table summary="method" width="100%" cellspacing="0" cellpadding="5" border="0">
<tr><td class="methodtitle">
<a name="M000011"></a>
<a href="Message.src/M000011.html" target="Code" class="methodtitle"
onClick="popCode('Message.src/M000011.html');return false;">
<b>==</b>(other)
</a>
</td></tr>
</table>
<div class="description">
<p>
Test if this message is structured exactly the same as the other message.
This is useful mainly for testing.
</p>
</div>
<table summary="method" width="100%" cellspacing="0" cellpadding="5" border="0">
<tr><td class="methodtitle">
<a name="M000012"></a>
<a href="Message.src/M000012.html" target="Code" class="methodtitle"
onClick="popCode('Message.src/M000012.html');return false;">
<b>body</b>()
</a>
</td></tr>
</table>
<div class="description">
<p>
Returns the body of the message as a String or Array.
</p>
<p>
If <a href="Message.html#M000015">#multipart?</a> returns true, it will be
an array of <a href="Message.html">RMail::Message</a> objects. Otherwise it
will be a String.
</p>
<p>
See also <a href="Message.html#M000014">#header</a>.
</p>
</div>
<table summary="method" width="100%" cellspacing="0" cellpadding="5" border="0">
<tr><td class="methodtitle">
<a name="M000013"></a>
<a href="Message.src/M000013.html" target="Code" class="methodtitle"
onClick="popCode('Message.src/M000013.html');return false;">
<b>body=</b>(s)
</a>
</td></tr>
</table>
<div class="description">
<p>
Sets the body of the message to the given value. It should either be a
String or an Array of <a href="../RMail.html">RMail</a>:<a
href="Message.html">Message</a> objects.
</p>
</div>
<table summary="method" width="100%" cellspacing="0" cellpadding="5" border="0">
<tr><td class="methodtitle">
<a name="M000014"></a>
<a href="Message.src/M000014.html" target="Code" class="methodtitle"
onClick="popCode('Message.src/M000014.html');return false;">
<b>header</b>()
</a>
</td></tr>
</table>
<div class="description">
<p>
Returns the <a href="Header.html">RMail::Header</a> object.
</p>
<p>
See also <a href="Message.html#M000012">#body</a>.
</p>
</div>
<table summary="method" width="100%" cellspacing="0" cellpadding="5" border="0">
<tr><td class="methodtitle">
<a name="M000015"></a>
<a href="Message.src/M000015.html" target="Code" class="methodtitle"
onClick="popCode('Message.src/M000015.html');return false;">
<b>multipart?</b>()
</a>
</td></tr>
</table>
<div class="description">
<p>
Return true if the message consists of multiple parts.
</p>
</div>
<table summary="method" width="100%" cellspacing="0" cellpadding="5" border="0">
<tr><td class="methodtitle">
<a name="M000016"></a>
<a href="Message.src/M000016.html" target="Code" class="methodtitle"
onClick="popCode('Message.src/M000016.html');return false;">
<b>add_part</b>(part)
</a>
</td></tr>
</table>
<div class="description">
<p>
Add a part to the message. After this message is called, the <a
href="Message.html#M000015">#multipart?</a> method will return true and the
<a href="Message.html#M000012">#body</a> method will #return an array of
parts.
</p>
</div>
<table summary="method" width="100%" cellspacing="0" cellpadding="5" border="0">
<tr><td class="methodtitle">
<a name="M000017"></a>
<a href="Message.src/M000017.html" target="Code" class="methodtitle"
onClick="popCode('Message.src/M000017.html');return false;">
<b>decode</b>()
</a>
</td></tr>
</table>
<div class="description">
<p>
Decode the body of this message.
</p>
<p>
If the body of this message is encoded with <tt>quoted-printable</tt> or
<tt>base64</tt>, this function will decode the data into its original form
and return it as a String. If the body is not encoded, it is returned
unaltered.
</p>
<p>
This only works when the message is not a multipart. The
<tt>Content-Transfer-Encoding:</tt> header field is consulted to determine
the encoding of the body part.
</p>
</div>
<table summary="method" width="100%" cellspacing="0" cellpadding="5" border="0">
<tr><td class="methodtitle">
<a name="M000018"></a>
<a href="Message.src/M000018.html" target="Code" class="methodtitle"
onClick="popCode('Message.src/M000018.html');return false;">
<b>part</b>(i)
</a>
</td></tr>
</table>
<div class="description">
<p>
Get the indicated part from a multipart message.
</p>
</div>
<table summary="method" width="100%" cellspacing="0" cellpadding="5" border="0">
<tr><td class="methodtitle">
<a name="M000019"></a>
<a href="Message.src/M000019.html" target="Code" class="methodtitle"
onClick="popCode('Message.src/M000019.html');return false;">
<b>to_s</b>()
</a>
</td></tr>
</table>
<div class="description">
<p>
Returns the entire message in a single string. This uses the <a
href="Serialize.html">RMail::Serialize</a> class.
</p>
</div>
<table summary="method" width="100%" cellspacing="0" cellpadding="5" border="0">
<tr><td class="methodtitle">
<a name="M000020"></a>
<a href="Message.src/M000020.html" target="Code" class="methodtitle"
onClick="popCode('Message.src/M000020.html');return false;">
<b>each_part</b>() {|part| ...}
</a>
</td></tr>
</table>
<div class="description">
<p>
Return each part of this message
</p>
<p>
FIXME: not tested
</p>
</div>
<table summary="method" width="100%" cellspacing="0" cellpadding="5" border="0">
<tr><td class="methodtitle">
<a name="M000021"></a>
<a href="Message.src/M000021.html" target="Code" class="methodtitle"
onClick="popCode('Message.src/M000021.html');return false;">
<b>each</b>() {|line| ...}
</a>
</td></tr>
</table>
<div class="description">
<p>
Call the supplied block for each line of the message. Each line will
contain a trailing newline (<tt>\n</tt>).
</p>
</div>
</body>
</html>
|