File: Parser.html

package info (click to toggle)
ruby-rubymail 1.0.0-1
  • links: PTS, VCS
  • area: main
  • in suites: wheezy
  • size: 2,056 kB
  • sloc: ruby: 6,061; makefile: 7
file content (123 lines) | stat: -rw-r--r-- 3,749 bytes parent folder | download | duplicates (5)
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

<?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::Address::Parser</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::Address::Parser
 </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/address_rb.html" class="aqua">
lib/rmail/address.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>
This class provides a facility to parse a string containing one or more
RFC2822 addresses into an array of <a
href="../Address.html">RMail::Address</a> objects. You can use it directly,
but it is more conveniently used with the <a
href="../Address.html">RMail::Address</a>.parse method.
</p>
</div>


<table summary="Methods" cellpadding="5" width="100%">
<tr><td class="tablesubtitle">Methods</td></tr>
</table>
<div class="name-list">
<a href="#M000121">new</a>&nbsp; &nbsp;
<a href="#M000122">parse</a>&nbsp; &nbsp;
</div>





<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="M000121"></a>
<a href="Parser.src/M000121.html" target="Code" class="methodtitle"
 onClick="popCode('Parser.src/M000121.html');return false;">
<b>new</b>(string)
</a>
</td></tr>
</table>
<div class="description">
<p>
Create a <a href="Parser.html">RMail::Address::Parser</a> object that will
parse <tt>string</tt>. See also the <a
href="../Address.html">RMail::Address</a>.parse method.
</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="M000122"></a>
<a href="Parser.src/M000122.html" target="Code" class="methodtitle"
 onClick="popCode('Parser.src/M000122.html');return false;">
<b>parse</b>()
</a>
</td></tr>
</table>
<div class="description">
<p>
This function attempts to extract mailing addresses from the string passed
to <a href="Parser.html#M000121">#new</a>. The function returns an <a
href="List.html">RMail::Address::List</a> of <a
href="../Address.html">RMail::Address</a> objects (<a
href="List.html">RMail::Address::List</a> is a subclass of Array). A
malformed input string will not generate an exception. Instead, the array
returned will simply not contained the malformed addresses.
</p>
<p>
The string is expected to be in a valid format as documented in
RFC2822&#8217;s mailbox-list grammar. This will work for lists of addresses
in the <tt>To:</tt>, <tt>From:</tt>, etc. headers in email.
</p>
</div>

</body>
</html>