mack-notifier 0.6.1.1 → 0.6.1.2
Sign up to get free protection for your applications and to get access to all the features.
- data/doc/classes/Mack/Errors/UnconvertedNotifier.html +111 -0
- data/doc/classes/Mack/Notifier.html +698 -0
- data/doc/classes/Mack/Notifier/Adapters/Base.html +134 -0
- data/doc/classes/Mack/Notifier/Adapters/Tmail.html +256 -0
- data/doc/classes/Mack/Notifier/Attachment.html +270 -0
- data/doc/classes/Mack/Notifier/DeliveryHandlers/SendMail.html +154 -0
- data/doc/classes/Mack/Notifier/DeliveryHandlers/Smtp.html +153 -0
- data/doc/classes/Mack/Notifier/DeliveryHandlers/Test.html +147 -0
- data/doc/classes/Mack/Notifier/Validatable.html +419 -0
- data/doc/classes/Mack/Paths.html +197 -0
- data/doc/classes/NotifierGenerator.html +133 -0
- data/doc/created.rid +1 -0
- data/doc/files/README.html +150 -0
- data/doc/files/lib/mack-notifier/adapters/base_rb.html +101 -0
- data/doc/files/lib/mack-notifier/adapters/tmail_rb.html +108 -0
- data/doc/files/lib/mack-notifier/attachment_rb.html +101 -0
- data/doc/files/lib/mack-notifier/delivery_handlers/sendmail_rb.html +101 -0
- data/doc/files/lib/mack-notifier/delivery_handlers/smtp_rb.html +108 -0
- data/doc/files/lib/mack-notifier/delivery_handlers/test_rb.html +101 -0
- data/doc/files/lib/mack-notifier/errors_rb.html +101 -0
- data/doc/files/lib/mack-notifier/loader_rb.html +107 -0
- data/doc/files/lib/mack-notifier/notifier_generator/notifier_generator_rb.html +123 -0
- data/doc/files/lib/mack-notifier/notifier_rb.html +101 -0
- data/doc/files/lib/mack-notifier/paths_rb.html +101 -0
- data/doc/files/lib/mack-notifier/rendering/type/mailer_rb.html +101 -0
- data/doc/files/lib/mack-notifier/settings_rb.html +101 -0
- data/doc/files/lib/mack-notifier/testing_rb.html +142 -0
- data/doc/files/lib/mack-notifier/validations_rb.html +101 -0
- data/doc/files/lib/mack-notifier_rb.html +110 -0
- data/doc/fr_class_index.html +37 -0
- data/doc/fr_file_index.html +43 -0
- data/doc/fr_method_index.html +61 -0
- data/doc/index.html +24 -0
- data/doc/rdoc-style.css +208 -0
- metadata +36 -2
@@ -0,0 +1,134 @@
|
|
1
|
+
<?xml version="1.0" encoding="iso-8859-1"?>
|
2
|
+
<!DOCTYPE html
|
3
|
+
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
4
|
+
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
5
|
+
|
6
|
+
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
7
|
+
<head>
|
8
|
+
<title>Class: Mack::Notifier::Adapters::Base</title>
|
9
|
+
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
|
10
|
+
<meta http-equiv="Content-Script-Type" content="text/javascript" />
|
11
|
+
<link rel="stylesheet" href="../../../.././rdoc-style.css" type="text/css" media="screen" />
|
12
|
+
<script type="text/javascript">
|
13
|
+
// <![CDATA[
|
14
|
+
|
15
|
+
function popupCode( url ) {
|
16
|
+
window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
|
17
|
+
}
|
18
|
+
|
19
|
+
function toggleCode( id ) {
|
20
|
+
if ( document.getElementById )
|
21
|
+
elem = document.getElementById( id );
|
22
|
+
else if ( document.all )
|
23
|
+
elem = eval( "document.all." + id );
|
24
|
+
else
|
25
|
+
return false;
|
26
|
+
|
27
|
+
elemStyle = elem.style;
|
28
|
+
|
29
|
+
if ( elemStyle.display != "block" ) {
|
30
|
+
elemStyle.display = "block"
|
31
|
+
} else {
|
32
|
+
elemStyle.display = "none"
|
33
|
+
}
|
34
|
+
|
35
|
+
return true;
|
36
|
+
}
|
37
|
+
|
38
|
+
// Make codeblocks hidden by default
|
39
|
+
document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" )
|
40
|
+
|
41
|
+
// ]]>
|
42
|
+
</script>
|
43
|
+
|
44
|
+
</head>
|
45
|
+
<body>
|
46
|
+
|
47
|
+
|
48
|
+
|
49
|
+
<div id="classHeader">
|
50
|
+
<table class="header-table">
|
51
|
+
<tr class="top-aligned-row">
|
52
|
+
<td><strong>Class</strong></td>
|
53
|
+
<td class="class-name-in-header">Mack::Notifier::Adapters::Base</td>
|
54
|
+
</tr>
|
55
|
+
<tr class="top-aligned-row">
|
56
|
+
<td><strong>In:</strong></td>
|
57
|
+
<td>
|
58
|
+
<a href="../../../../files/lib/mack-notifier/adapters/base_rb.html">
|
59
|
+
lib/mack-notifier/adapters/base.rb
|
60
|
+
</a>
|
61
|
+
<br />
|
62
|
+
</td>
|
63
|
+
</tr>
|
64
|
+
|
65
|
+
<tr class="top-aligned-row">
|
66
|
+
<td><strong>Parent:</strong></td>
|
67
|
+
<td>
|
68
|
+
Object
|
69
|
+
</td>
|
70
|
+
</tr>
|
71
|
+
</table>
|
72
|
+
</div>
|
73
|
+
<!-- banner header -->
|
74
|
+
|
75
|
+
<div id="bodyContent">
|
76
|
+
|
77
|
+
|
78
|
+
|
79
|
+
<div id="contextContent">
|
80
|
+
|
81
|
+
<div id="description">
|
82
|
+
<p>
|
83
|
+
All mail adapters need to extend this class.
|
84
|
+
</p>
|
85
|
+
|
86
|
+
</div>
|
87
|
+
|
88
|
+
|
89
|
+
</div>
|
90
|
+
|
91
|
+
|
92
|
+
</div>
|
93
|
+
|
94
|
+
|
95
|
+
<!-- if includes -->
|
96
|
+
|
97
|
+
<div id="section">
|
98
|
+
|
99
|
+
|
100
|
+
|
101
|
+
|
102
|
+
|
103
|
+
<div id="attribute-list">
|
104
|
+
<h3 class="section-bar">Attributes</h3>
|
105
|
+
|
106
|
+
<div class="name-list">
|
107
|
+
<table>
|
108
|
+
<tr class="top-aligned-row context-row">
|
109
|
+
<td class="context-item-name">mack_notifier</td>
|
110
|
+
<td class="context-item-value"> [RW] </td>
|
111
|
+
<td class="context-item-desc">
|
112
|
+
The origina <a href="../../Notifier.html">Mack::Notifier</a> object passed
|
113
|
+
in.
|
114
|
+
|
115
|
+
</td>
|
116
|
+
</tr>
|
117
|
+
</table>
|
118
|
+
</div>
|
119
|
+
</div>
|
120
|
+
|
121
|
+
|
122
|
+
|
123
|
+
<!-- if method_list -->
|
124
|
+
|
125
|
+
|
126
|
+
</div>
|
127
|
+
|
128
|
+
|
129
|
+
<div id="validator-badges">
|
130
|
+
<p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
|
131
|
+
</div>
|
132
|
+
|
133
|
+
</body>
|
134
|
+
</html>
|
@@ -0,0 +1,256 @@
|
|
1
|
+
<?xml version="1.0" encoding="iso-8859-1"?>
|
2
|
+
<!DOCTYPE html
|
3
|
+
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
4
|
+
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
5
|
+
|
6
|
+
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
7
|
+
<head>
|
8
|
+
<title>Class: Mack::Notifier::Adapters::Tmail</title>
|
9
|
+
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
|
10
|
+
<meta http-equiv="Content-Script-Type" content="text/javascript" />
|
11
|
+
<link rel="stylesheet" href="../../../.././rdoc-style.css" type="text/css" media="screen" />
|
12
|
+
<script type="text/javascript">
|
13
|
+
// <![CDATA[
|
14
|
+
|
15
|
+
function popupCode( url ) {
|
16
|
+
window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
|
17
|
+
}
|
18
|
+
|
19
|
+
function toggleCode( id ) {
|
20
|
+
if ( document.getElementById )
|
21
|
+
elem = document.getElementById( id );
|
22
|
+
else if ( document.all )
|
23
|
+
elem = eval( "document.all." + id );
|
24
|
+
else
|
25
|
+
return false;
|
26
|
+
|
27
|
+
elemStyle = elem.style;
|
28
|
+
|
29
|
+
if ( elemStyle.display != "block" ) {
|
30
|
+
elemStyle.display = "block"
|
31
|
+
} else {
|
32
|
+
elemStyle.display = "none"
|
33
|
+
}
|
34
|
+
|
35
|
+
return true;
|
36
|
+
}
|
37
|
+
|
38
|
+
// Make codeblocks hidden by default
|
39
|
+
document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" )
|
40
|
+
|
41
|
+
// ]]>
|
42
|
+
</script>
|
43
|
+
|
44
|
+
</head>
|
45
|
+
<body>
|
46
|
+
|
47
|
+
|
48
|
+
|
49
|
+
<div id="classHeader">
|
50
|
+
<table class="header-table">
|
51
|
+
<tr class="top-aligned-row">
|
52
|
+
<td><strong>Class</strong></td>
|
53
|
+
<td class="class-name-in-header">Mack::Notifier::Adapters::Tmail</td>
|
54
|
+
</tr>
|
55
|
+
<tr class="top-aligned-row">
|
56
|
+
<td><strong>In:</strong></td>
|
57
|
+
<td>
|
58
|
+
<a href="../../../../files/lib/mack-notifier/adapters/tmail_rb.html">
|
59
|
+
lib/mack-notifier/adapters/tmail.rb
|
60
|
+
</a>
|
61
|
+
<br />
|
62
|
+
</td>
|
63
|
+
</tr>
|
64
|
+
|
65
|
+
<tr class="top-aligned-row">
|
66
|
+
<td><strong>Parent:</strong></td>
|
67
|
+
<td>
|
68
|
+
<a href="Base.html">
|
69
|
+
Mack::Notifier::Adapters::Base
|
70
|
+
</a>
|
71
|
+
</td>
|
72
|
+
</tr>
|
73
|
+
</table>
|
74
|
+
</div>
|
75
|
+
<!-- banner header -->
|
76
|
+
|
77
|
+
<div id="bodyContent">
|
78
|
+
|
79
|
+
|
80
|
+
|
81
|
+
<div id="contextContent">
|
82
|
+
|
83
|
+
<div id="description">
|
84
|
+
<p>
|
85
|
+
Converts a <a href="../../Notifier.html">Mack::Notifier</a> object into a
|
86
|
+
TMail object.
|
87
|
+
</p>
|
88
|
+
|
89
|
+
</div>
|
90
|
+
|
91
|
+
|
92
|
+
</div>
|
93
|
+
|
94
|
+
<div id="method-list">
|
95
|
+
<h3 class="section-bar">Methods</h3>
|
96
|
+
|
97
|
+
<div class="name-list">
|
98
|
+
<a href="#M000025">convert</a>
|
99
|
+
<a href="#M000024">deliverable</a>
|
100
|
+
<a href="#M000023">transformed</a>
|
101
|
+
</div>
|
102
|
+
</div>
|
103
|
+
|
104
|
+
</div>
|
105
|
+
|
106
|
+
|
107
|
+
<!-- if includes -->
|
108
|
+
|
109
|
+
<div id="section">
|
110
|
+
|
111
|
+
|
112
|
+
|
113
|
+
|
114
|
+
|
115
|
+
|
116
|
+
|
117
|
+
|
118
|
+
<!-- if method_list -->
|
119
|
+
<div id="methods">
|
120
|
+
<h3 class="section-bar">Public Instance methods</h3>
|
121
|
+
|
122
|
+
<div id="method-M000025" class="method-detail">
|
123
|
+
<a name="M000025"></a>
|
124
|
+
|
125
|
+
<div class="method-heading">
|
126
|
+
<a href="#M000025" class="method-signature">
|
127
|
+
<span class="method-name">convert</span><span class="method-args">()</span>
|
128
|
+
</a>
|
129
|
+
</div>
|
130
|
+
|
131
|
+
<div class="method-description">
|
132
|
+
<p>
|
133
|
+
Converts the <a href="../../Notifier.html">Mack::Notifier</a> object to a
|
134
|
+
TMail object.
|
135
|
+
</p>
|
136
|
+
<p><a class="source-toggle" href="#"
|
137
|
+
onclick="toggleCode('M000025-source');return false;">[Source]</a></p>
|
138
|
+
<div class="method-source-code" id="M000025-source">
|
139
|
+
<pre>
|
140
|
+
<span class="ruby-comment cmt"># File lib/mack-notifier/adapters/tmail.rb, line 23</span>
|
141
|
+
23: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">convert</span>
|
142
|
+
24: <span class="ruby-ivar">@tmail</span> = <span class="ruby-constant">TMail</span><span class="ruby-operator">::</span><span class="ruby-constant">Mail</span>.<span class="ruby-identifier">new</span>
|
143
|
+
25: <span class="ruby-ivar">@tmail</span>.<span class="ruby-identifier">to</span> = <span class="ruby-identifier">mack_notifier</span>.<span class="ruby-identifier">to</span>
|
144
|
+
26: <span class="ruby-ivar">@tmail</span>.<span class="ruby-identifier">cc</span> = <span class="ruby-identifier">mack_notifier</span>.<span class="ruby-identifier">cc</span>
|
145
|
+
27: <span class="ruby-ivar">@tmail</span>.<span class="ruby-identifier">bcc</span> = <span class="ruby-identifier">mack_notifier</span>.<span class="ruby-identifier">bcc</span>
|
146
|
+
28: <span class="ruby-ivar">@tmail</span>.<span class="ruby-identifier">reply_to</span> = <span class="ruby-identifier">mack_notifier</span>.<span class="ruby-identifier">reply_to</span>
|
147
|
+
29: <span class="ruby-ivar">@tmail</span>.<span class="ruby-identifier">from</span> = <span class="ruby-identifier">mack_notifier</span>.<span class="ruby-identifier">from</span>
|
148
|
+
30: <span class="ruby-ivar">@tmail</span>.<span class="ruby-identifier">subject</span> = <span class="ruby-identifier">mack_notifier</span>.<span class="ruby-identifier">subject</span>
|
149
|
+
31: <span class="ruby-ivar">@tmail</span>.<span class="ruby-identifier">date</span> = <span class="ruby-identifier">mack_notifier</span>.<span class="ruby-identifier">date_sent</span>
|
150
|
+
32: <span class="ruby-ivar">@tmail</span>.<span class="ruby-identifier">mime_version</span> = <span class="ruby-identifier">mack_notifier</span>.<span class="ruby-identifier">mime_version</span>
|
151
|
+
33:
|
152
|
+
34: <span class="ruby-comment cmt"># set text and html bodies</span>
|
153
|
+
35: <span class="ruby-identifier">main_body</span> = <span class="ruby-constant">TMail</span><span class="ruby-operator">::</span><span class="ruby-constant">Mail</span>.<span class="ruby-identifier">new</span>
|
154
|
+
36: <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">mack_notifier</span>.<span class="ruby-identifier">body</span>(<span class="ruby-identifier">:plain</span>).<span class="ruby-identifier">blank?</span>
|
155
|
+
37: <span class="ruby-identifier">text</span> = <span class="ruby-constant">TMail</span><span class="ruby-operator">::</span><span class="ruby-constant">Mail</span>.<span class="ruby-identifier">new</span>
|
156
|
+
38: <span class="ruby-identifier">text</span>.<span class="ruby-identifier">content_type</span> = <span class="ruby-value str">"text/plain"</span>
|
157
|
+
39: <span class="ruby-identifier">text</span>.<span class="ruby-identifier">body</span> = <span class="ruby-identifier">mack_notifier</span>.<span class="ruby-identifier">body</span>(<span class="ruby-identifier">:plain</span>)
|
158
|
+
40: <span class="ruby-identifier">main_body</span>.<span class="ruby-identifier">parts</span> <span class="ruby-operator"><<</span> <span class="ruby-identifier">text</span>
|
159
|
+
41: <span class="ruby-keyword kw">end</span>
|
160
|
+
42: <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">mack_notifier</span>.<span class="ruby-identifier">body</span>(<span class="ruby-identifier">:html</span>).<span class="ruby-identifier">blank?</span>
|
161
|
+
43: <span class="ruby-identifier">html</span> = <span class="ruby-constant">TMail</span><span class="ruby-operator">::</span><span class="ruby-constant">Mail</span>.<span class="ruby-identifier">new</span>
|
162
|
+
44: <span class="ruby-identifier">html</span>.<span class="ruby-identifier">content_type</span> = <span class="ruby-value str">"text/html"</span>
|
163
|
+
45: <span class="ruby-identifier">html</span>.<span class="ruby-identifier">body</span> = <span class="ruby-identifier">mack_notifier</span>.<span class="ruby-identifier">body</span>(<span class="ruby-identifier">:html</span>)
|
164
|
+
46: <span class="ruby-identifier">main_body</span>.<span class="ruby-identifier">parts</span> <span class="ruby-operator"><<</span> <span class="ruby-identifier">html</span>
|
165
|
+
47: <span class="ruby-keyword kw">end</span>
|
166
|
+
48: <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">main_body</span>.<span class="ruby-identifier">parts</span>.<span class="ruby-identifier">empty?</span>
|
167
|
+
49: <span class="ruby-identifier">main_body</span>.<span class="ruby-identifier">content_type</span> = <span class="ruby-value str">"multipart/alternative"</span>
|
168
|
+
50: <span class="ruby-ivar">@tmail</span>.<span class="ruby-identifier">parts</span> <span class="ruby-operator"><<</span> <span class="ruby-identifier">main_body</span>
|
169
|
+
51: <span class="ruby-keyword kw">end</span>
|
170
|
+
52:
|
171
|
+
53: <span class="ruby-comment cmt"># set attachments, if any.</span>
|
172
|
+
54: <span class="ruby-identifier">mack_notifier</span>.<span class="ruby-identifier">attachments</span>.<span class="ruby-identifier">each</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">at</span><span class="ruby-operator">|</span>
|
173
|
+
55: <span class="ruby-identifier">attachment</span> = <span class="ruby-constant">TMail</span><span class="ruby-operator">::</span><span class="ruby-constant">Mail</span>.<span class="ruby-identifier">new</span>
|
174
|
+
56: <span class="ruby-identifier">attachment</span>.<span class="ruby-identifier">body</span> = <span class="ruby-constant">Base64</span>.<span class="ruby-identifier">encode64</span>(<span class="ruby-identifier">at</span>.<span class="ruby-identifier">body</span>)
|
175
|
+
57: <span class="ruby-identifier">attachment</span>.<span class="ruby-identifier">transfer_encoding</span> = <span class="ruby-value str">"Base64"</span>
|
176
|
+
58: <span class="ruby-identifier">attachment</span>.<span class="ruby-identifier">content_type</span> = <span class="ruby-value str">"application/octet-stream"</span>
|
177
|
+
59: <span class="ruby-identifier">attachment</span>[<span class="ruby-value str">'Content-Disposition'</span>] = <span class="ruby-node">"attachment; filename=#{at.file_name}"</span>
|
178
|
+
60: <span class="ruby-ivar">@tmail</span>.<span class="ruby-identifier">parts</span> <span class="ruby-operator"><<</span> <span class="ruby-identifier">attachment</span>
|
179
|
+
61: <span class="ruby-keyword kw">end</span>
|
180
|
+
62:
|
181
|
+
63: <span class="ruby-ivar">@tmail</span>.<span class="ruby-identifier">content_type</span> = <span class="ruby-identifier">mack_notifier</span>.<span class="ruby-identifier">content_type</span>
|
182
|
+
64: <span class="ruby-keyword kw">end</span>
|
183
|
+
</pre>
|
184
|
+
</div>
|
185
|
+
</div>
|
186
|
+
</div>
|
187
|
+
|
188
|
+
<div id="method-M000024" class="method-detail">
|
189
|
+
<a name="M000024"></a>
|
190
|
+
|
191
|
+
<div class="method-heading">
|
192
|
+
<a href="#M000024" class="method-signature">
|
193
|
+
<span class="method-name">deliverable</span><span class="method-args">()</span>
|
194
|
+
</a>
|
195
|
+
</div>
|
196
|
+
|
197
|
+
<div class="method-description">
|
198
|
+
<p>
|
199
|
+
Returns the ready to be delivered encoded String
|
200
|
+
</p>
|
201
|
+
<p><a class="source-toggle" href="#"
|
202
|
+
onclick="toggleCode('M000024-source');return false;">[Source]</a></p>
|
203
|
+
<div class="method-source-code" id="M000024-source">
|
204
|
+
<pre>
|
205
|
+
<span class="ruby-comment cmt"># File lib/mack-notifier/adapters/tmail.rb, line 18</span>
|
206
|
+
18: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">deliverable</span>
|
207
|
+
19: <span class="ruby-identifier">transformed</span>.<span class="ruby-identifier">encoded</span>
|
208
|
+
20: <span class="ruby-keyword kw">end</span>
|
209
|
+
</pre>
|
210
|
+
</div>
|
211
|
+
</div>
|
212
|
+
</div>
|
213
|
+
|
214
|
+
<div id="method-M000023" class="method-detail">
|
215
|
+
<a name="M000023"></a>
|
216
|
+
|
217
|
+
<div class="method-heading">
|
218
|
+
<a href="#M000023" class="method-signature">
|
219
|
+
<span class="method-name">transformed</span><span class="method-args">()</span>
|
220
|
+
</a>
|
221
|
+
</div>
|
222
|
+
|
223
|
+
<div class="method-description">
|
224
|
+
<p>
|
225
|
+
Returns the underlying TMail object. Raises <a
|
226
|
+
href="../../Errors/UnconvertedNotifier.html">Mack::Errors::UnconvertedNotifier</a>
|
227
|
+
if the <a href="Tmail.html#M000025">convert</a> method hasn‘t been
|
228
|
+
called first.
|
229
|
+
</p>
|
230
|
+
<p><a class="source-toggle" href="#"
|
231
|
+
onclick="toggleCode('M000023-source');return false;">[Source]</a></p>
|
232
|
+
<div class="method-source-code" id="M000023-source">
|
233
|
+
<pre>
|
234
|
+
<span class="ruby-comment cmt"># File lib/mack-notifier/adapters/tmail.rb, line 12</span>
|
235
|
+
12: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">transformed</span>
|
236
|
+
13: <span class="ruby-identifier">raise</span> <span class="ruby-constant">Mack</span><span class="ruby-operator">::</span><span class="ruby-constant">Errors</span><span class="ruby-operator">::</span><span class="ruby-constant">UnconvertedNotifier</span>.<span class="ruby-identifier">new</span> <span class="ruby-keyword kw">if</span> <span class="ruby-ivar">@tmail</span>.<span class="ruby-identifier">nil?</span>
|
237
|
+
14: <span class="ruby-ivar">@tmail</span>
|
238
|
+
15: <span class="ruby-keyword kw">end</span>
|
239
|
+
</pre>
|
240
|
+
</div>
|
241
|
+
</div>
|
242
|
+
</div>
|
243
|
+
|
244
|
+
|
245
|
+
</div>
|
246
|
+
|
247
|
+
|
248
|
+
</div>
|
249
|
+
|
250
|
+
|
251
|
+
<div id="validator-badges">
|
252
|
+
<p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
|
253
|
+
</div>
|
254
|
+
|
255
|
+
</body>
|
256
|
+
</html>
|
@@ -0,0 +1,270 @@
|
|
1
|
+
<?xml version="1.0" encoding="iso-8859-1"?>
|
2
|
+
<!DOCTYPE html
|
3
|
+
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
4
|
+
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
5
|
+
|
6
|
+
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
7
|
+
<head>
|
8
|
+
<title>Class: Mack::Notifier::Attachment</title>
|
9
|
+
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
|
10
|
+
<meta http-equiv="Content-Script-Type" content="text/javascript" />
|
11
|
+
<link rel="stylesheet" href="../../.././rdoc-style.css" type="text/css" media="screen" />
|
12
|
+
<script type="text/javascript">
|
13
|
+
// <![CDATA[
|
14
|
+
|
15
|
+
function popupCode( url ) {
|
16
|
+
window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
|
17
|
+
}
|
18
|
+
|
19
|
+
function toggleCode( id ) {
|
20
|
+
if ( document.getElementById )
|
21
|
+
elem = document.getElementById( id );
|
22
|
+
else if ( document.all )
|
23
|
+
elem = eval( "document.all." + id );
|
24
|
+
else
|
25
|
+
return false;
|
26
|
+
|
27
|
+
elemStyle = elem.style;
|
28
|
+
|
29
|
+
if ( elemStyle.display != "block" ) {
|
30
|
+
elemStyle.display = "block"
|
31
|
+
} else {
|
32
|
+
elemStyle.display = "none"
|
33
|
+
}
|
34
|
+
|
35
|
+
return true;
|
36
|
+
}
|
37
|
+
|
38
|
+
// Make codeblocks hidden by default
|
39
|
+
document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" )
|
40
|
+
|
41
|
+
// ]]>
|
42
|
+
</script>
|
43
|
+
|
44
|
+
</head>
|
45
|
+
<body>
|
46
|
+
|
47
|
+
|
48
|
+
|
49
|
+
<div id="classHeader">
|
50
|
+
<table class="header-table">
|
51
|
+
<tr class="top-aligned-row">
|
52
|
+
<td><strong>Class</strong></td>
|
53
|
+
<td class="class-name-in-header">Mack::Notifier::Attachment</td>
|
54
|
+
</tr>
|
55
|
+
<tr class="top-aligned-row">
|
56
|
+
<td><strong>In:</strong></td>
|
57
|
+
<td>
|
58
|
+
<a href="../../../files/lib/mack-notifier/attachment_rb.html">
|
59
|
+
lib/mack-notifier/attachment.rb
|
60
|
+
</a>
|
61
|
+
<br />
|
62
|
+
</td>
|
63
|
+
</tr>
|
64
|
+
|
65
|
+
<tr class="top-aligned-row">
|
66
|
+
<td><strong>Parent:</strong></td>
|
67
|
+
<td>
|
68
|
+
Object
|
69
|
+
</td>
|
70
|
+
</tr>
|
71
|
+
</table>
|
72
|
+
</div>
|
73
|
+
<!-- banner header -->
|
74
|
+
|
75
|
+
<div id="bodyContent">
|
76
|
+
|
77
|
+
|
78
|
+
|
79
|
+
<div id="contextContent">
|
80
|
+
|
81
|
+
<div id="description">
|
82
|
+
<p>
|
83
|
+
Creates an attachment for a <a href="../Notifier.html">Mack::Notifier</a>
|
84
|
+
object.
|
85
|
+
</p>
|
86
|
+
|
87
|
+
</div>
|
88
|
+
|
89
|
+
|
90
|
+
</div>
|
91
|
+
|
92
|
+
<div id="method-list">
|
93
|
+
<h3 class="section-bar">Methods</h3>
|
94
|
+
|
95
|
+
<div class="name-list">
|
96
|
+
<a href="#M000034">add_file</a>
|
97
|
+
<a href="#M000033">add_io</a>
|
98
|
+
<a href="#M000035">add_uploaded_file</a>
|
99
|
+
<a href="#M000032">new</a>
|
100
|
+
</div>
|
101
|
+
</div>
|
102
|
+
|
103
|
+
</div>
|
104
|
+
|
105
|
+
|
106
|
+
<!-- if includes -->
|
107
|
+
|
108
|
+
<div id="section">
|
109
|
+
|
110
|
+
|
111
|
+
|
112
|
+
|
113
|
+
|
114
|
+
<div id="attribute-list">
|
115
|
+
<h3 class="section-bar">Attributes</h3>
|
116
|
+
|
117
|
+
<div class="name-list">
|
118
|
+
<table>
|
119
|
+
<tr class="top-aligned-row context-row">
|
120
|
+
<td class="context-item-name">body</td>
|
121
|
+
<td class="context-item-value"> [RW] </td>
|
122
|
+
<td class="context-item-desc">
|
123
|
+
Returns a String representing the body of the attachment. This String is
|
124
|
+
NOT encoded in anyway!
|
125
|
+
|
126
|
+
</td>
|
127
|
+
</tr>
|
128
|
+
<tr class="top-aligned-row context-row">
|
129
|
+
<td class="context-item-name">file_name</td>
|
130
|
+
<td class="context-item-value"> [RW] </td>
|
131
|
+
<td class="context-item-desc">
|
132
|
+
Returns the name of the attached file.
|
133
|
+
|
134
|
+
</td>
|
135
|
+
</tr>
|
136
|
+
</table>
|
137
|
+
</div>
|
138
|
+
</div>
|
139
|
+
|
140
|
+
|
141
|
+
|
142
|
+
<!-- if method_list -->
|
143
|
+
<div id="methods">
|
144
|
+
<h3 class="section-bar">Public Class methods</h3>
|
145
|
+
|
146
|
+
<div id="method-M000032" class="method-detail">
|
147
|
+
<a name="M000032"></a>
|
148
|
+
|
149
|
+
<div class="method-heading">
|
150
|
+
<a href="#M000032" class="method-signature">
|
151
|
+
<span class="method-name">new</span><span class="method-args">(body = nil)</span>
|
152
|
+
</a>
|
153
|
+
</div>
|
154
|
+
|
155
|
+
<div class="method-description">
|
156
|
+
<p><a class="source-toggle" href="#"
|
157
|
+
onclick="toggleCode('M000032-source');return false;">[Source]</a></p>
|
158
|
+
<div class="method-source-code" id="M000032-source">
|
159
|
+
<pre>
|
160
|
+
<span class="ruby-comment cmt"># File lib/mack-notifier/attachment.rb, line 11</span>
|
161
|
+
11: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">initialize</span>(<span class="ruby-identifier">body</span> = <span class="ruby-keyword kw">nil</span>)
|
162
|
+
12: <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">body</span>.<span class="ruby-identifier">nil?</span>
|
163
|
+
13: <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">add_file</span>(<span class="ruby-identifier">body</span>) <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">body</span>.<span class="ruby-identifier">is_a?</span>(<span class="ruby-constant">String</span>)
|
164
|
+
14: <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">add_io</span>(<span class="ruby-identifier">body</span>) <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">body</span>.<span class="ruby-identifier">is_a?</span>(<span class="ruby-constant">IO</span>)
|
165
|
+
15: <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">add_uploaded_file</span>(<span class="ruby-identifier">body</span>) <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">body</span>.<span class="ruby-identifier">is_a?</span>(<span class="ruby-constant">Mack</span><span class="ruby-operator">::</span><span class="ruby-constant">Request</span><span class="ruby-operator">::</span><span class="ruby-constant">UploadedFile</span>)
|
166
|
+
16: <span class="ruby-keyword kw">end</span>
|
167
|
+
17: <span class="ruby-keyword kw">end</span>
|
168
|
+
</pre>
|
169
|
+
</div>
|
170
|
+
</div>
|
171
|
+
</div>
|
172
|
+
|
173
|
+
<h3 class="section-bar">Public Instance methods</h3>
|
174
|
+
|
175
|
+
<div id="method-M000034" class="method-detail">
|
176
|
+
<a name="M000034"></a>
|
177
|
+
|
178
|
+
<div class="method-heading">
|
179
|
+
<a href="#M000034" class="method-signature">
|
180
|
+
<span class="method-name">add_file</span><span class="method-args">(file)</span>
|
181
|
+
</a>
|
182
|
+
</div>
|
183
|
+
|
184
|
+
<div class="method-description">
|
185
|
+
<p>
|
186
|
+
Takes a path to a file, reads it in, and sets the file_name based on the
|
187
|
+
path.
|
188
|
+
</p>
|
189
|
+
<p><a class="source-toggle" href="#"
|
190
|
+
onclick="toggleCode('M000034-source');return false;">[Source]</a></p>
|
191
|
+
<div class="method-source-code" id="M000034-source">
|
192
|
+
<pre>
|
193
|
+
<span class="ruby-comment cmt"># File lib/mack-notifier/attachment.rb, line 25</span>
|
194
|
+
25: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">add_file</span>(<span class="ruby-identifier">file</span>)
|
195
|
+
26: <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">file_name</span> = <span class="ruby-constant">File</span>.<span class="ruby-identifier">basename</span>(<span class="ruby-identifier">file</span>)
|
196
|
+
27: <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">body</span> = <span class="ruby-constant">File</span>.<span class="ruby-identifier">read</span>(<span class="ruby-identifier">file</span>)
|
197
|
+
28: <span class="ruby-keyword kw">end</span>
|
198
|
+
</pre>
|
199
|
+
</div>
|
200
|
+
</div>
|
201
|
+
</div>
|
202
|
+
|
203
|
+
<div id="method-M000033" class="method-detail">
|
204
|
+
<a name="M000033"></a>
|
205
|
+
|
206
|
+
<div class="method-heading">
|
207
|
+
<a href="#M000033" class="method-signature">
|
208
|
+
<span class="method-name">add_io</span><span class="method-args">(io)</span>
|
209
|
+
</a>
|
210
|
+
</div>
|
211
|
+
|
212
|
+
<div class="method-description">
|
213
|
+
<p>
|
214
|
+
Takes an IO object and sets the body. You‘ll need to explicity set
|
215
|
+
the file_name afterwards.
|
216
|
+
</p>
|
217
|
+
<p><a class="source-toggle" href="#"
|
218
|
+
onclick="toggleCode('M000033-source');return false;">[Source]</a></p>
|
219
|
+
<div class="method-source-code" id="M000033-source">
|
220
|
+
<pre>
|
221
|
+
<span class="ruby-comment cmt"># File lib/mack-notifier/attachment.rb, line 20</span>
|
222
|
+
20: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">add_io</span>(<span class="ruby-identifier">io</span>)
|
223
|
+
21: <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">body</span> = <span class="ruby-identifier">io</span>.<span class="ruby-identifier">read</span>
|
224
|
+
22: <span class="ruby-keyword kw">end</span>
|
225
|
+
</pre>
|
226
|
+
</div>
|
227
|
+
</div>
|
228
|
+
</div>
|
229
|
+
|
230
|
+
<div id="method-M000035" class="method-detail">
|
231
|
+
<a name="M000035"></a>
|
232
|
+
|
233
|
+
<div class="method-heading">
|
234
|
+
<a href="#M000035" class="method-signature">
|
235
|
+
<span class="method-name">add_uploaded_file</span><span class="method-args">(file)</span>
|
236
|
+
</a>
|
237
|
+
</div>
|
238
|
+
|
239
|
+
<div class="method-description">
|
240
|
+
<p>
|
241
|
+
Takes a Mack::Request::UploadedFile file object, reads it in, and sets the
|
242
|
+
file name.
|
243
|
+
</p>
|
244
|
+
<p><a class="source-toggle" href="#"
|
245
|
+
onclick="toggleCode('M000035-source');return false;">[Source]</a></p>
|
246
|
+
<div class="method-source-code" id="M000035-source">
|
247
|
+
<pre>
|
248
|
+
<span class="ruby-comment cmt"># File lib/mack-notifier/attachment.rb, line 31</span>
|
249
|
+
31: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">add_uploaded_file</span>(<span class="ruby-identifier">file</span>)
|
250
|
+
32: <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">body</span> = <span class="ruby-constant">File</span>.<span class="ruby-identifier">read</span>(<span class="ruby-identifier">file</span>.<span class="ruby-identifier">temp_file</span>.<span class="ruby-identifier">path</span>)
|
251
|
+
33: <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">file_name</span> = <span class="ruby-identifier">file</span>.<span class="ruby-identifier">file_name</span>
|
252
|
+
34: <span class="ruby-keyword kw">end</span>
|
253
|
+
</pre>
|
254
|
+
</div>
|
255
|
+
</div>
|
256
|
+
</div>
|
257
|
+
|
258
|
+
|
259
|
+
</div>
|
260
|
+
|
261
|
+
|
262
|
+
</div>
|
263
|
+
|
264
|
+
|
265
|
+
<div id="validator-badges">
|
266
|
+
<p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
|
267
|
+
</div>
|
268
|
+
|
269
|
+
</body>
|
270
|
+
</html>
|