mack-notifier 0.7.1 → 0.7.1.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (35) hide show
  1. metadata +2 -36
  2. data/doc/classes/Mack/Errors/UnconvertedNotifier.html +0 -111
  3. data/doc/classes/Mack/Notifier.html +0 -698
  4. data/doc/classes/Mack/Notifier/Adapters/Base.html +0 -134
  5. data/doc/classes/Mack/Notifier/Adapters/Tmail.html +0 -265
  6. data/doc/classes/Mack/Notifier/Attachment.html +0 -270
  7. data/doc/classes/Mack/Notifier/DeliveryHandlers/Sendmail.html +0 -154
  8. data/doc/classes/Mack/Notifier/DeliveryHandlers/Smtp.html +0 -153
  9. data/doc/classes/Mack/Notifier/DeliveryHandlers/Test.html +0 -147
  10. data/doc/classes/Mack/Notifier/Validatable.html +0 -419
  11. data/doc/classes/Mack/Paths.html +0 -197
  12. data/doc/classes/NotifierGenerator.html +0 -133
  13. data/doc/created.rid +0 -1
  14. data/doc/files/README.html +0 -150
  15. data/doc/files/lib/mack-notifier/adapters/base_rb.html +0 -101
  16. data/doc/files/lib/mack-notifier/adapters/tmail_rb.html +0 -108
  17. data/doc/files/lib/mack-notifier/attachment_rb.html +0 -101
  18. data/doc/files/lib/mack-notifier/delivery_handlers/sendmail_rb.html +0 -101
  19. data/doc/files/lib/mack-notifier/delivery_handlers/smtp_rb.html +0 -108
  20. data/doc/files/lib/mack-notifier/delivery_handlers/test_rb.html +0 -101
  21. data/doc/files/lib/mack-notifier/errors_rb.html +0 -101
  22. data/doc/files/lib/mack-notifier/loader_rb.html +0 -107
  23. data/doc/files/lib/mack-notifier/notifier_generator/notifier_generator_rb.html +0 -123
  24. data/doc/files/lib/mack-notifier/notifier_rb.html +0 -101
  25. data/doc/files/lib/mack-notifier/paths_rb.html +0 -101
  26. data/doc/files/lib/mack-notifier/rendering/type/mailer_rb.html +0 -101
  27. data/doc/files/lib/mack-notifier/settings_rb.html +0 -101
  28. data/doc/files/lib/mack-notifier/testing_rb.html +0 -142
  29. data/doc/files/lib/mack-notifier/validations_rb.html +0 -101
  30. data/doc/files/lib/mack-notifier_rb.html +0 -110
  31. data/doc/fr_class_index.html +0 -37
  32. data/doc/fr_file_index.html +0 -43
  33. data/doc/fr_method_index.html +0 -61
  34. data/doc/index.html +0 -24
  35. data/doc/rdoc-style.css +0 -208
@@ -1,134 +0,0 @@
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">&nbsp;[RW]&nbsp;</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>
@@ -1,265 +0,0 @@
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="#M000031">convert</a>&nbsp;&nbsp;
99
- <a href="#M000030">deliverable</a>&nbsp;&nbsp;
100
- <a href="#M000029">transformed</a>&nbsp;&nbsp;
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-M000031" class="method-detail">
123
- <a name="M000031"></a>
124
-
125
- <div class="method-heading">
126
- <a href="#M000031" 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('M000031-source');return false;">[Source]</a></p>
138
- <div class="method-source-code" id="M000031-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">&quot;text/plain&quot;</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">&lt;&lt;</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">&quot;text/html&quot;</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">&lt;&lt;</span> <span class="ruby-identifier">html</span>
165
- 47: <span class="ruby-keyword kw">end</span>
166
- 48:
167
- 49: <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>
168
- 50: <span class="ruby-identifier">main_body</span>.<span class="ruby-identifier">content_type</span> = <span class="ruby-value str">&quot;multipart/alternative&quot;</span>
169
- 51: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">mack_notifier</span>.<span class="ruby-identifier">attachments</span>.<span class="ruby-identifier">any?</span> <span class="ruby-comment cmt"># there's an attachment</span>
170
- 52: <span class="ruby-ivar">@tmail</span>.<span class="ruby-identifier">parts</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-identifier">main_body</span>
171
- 53: <span class="ruby-keyword kw">else</span>
172
- 54: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">main_body</span>.<span class="ruby-identifier">parts</span>.<span class="ruby-identifier">size</span> <span class="ruby-operator">==</span> <span class="ruby-value">1</span>
173
- 55: <span class="ruby-ivar">@tmail</span>.<span class="ruby-identifier">body</span> = <span class="ruby-identifier">main_body</span>.<span class="ruby-identifier">parts</span>.<span class="ruby-identifier">first</span>.<span class="ruby-identifier">body</span>
174
- 56: <span class="ruby-keyword kw">else</span>
175
- 57: <span class="ruby-ivar">@tmail</span>.<span class="ruby-identifier">parts</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-identifier">main_body</span>
176
- 58: <span class="ruby-keyword kw">end</span>
177
- 59: <span class="ruby-keyword kw">end</span>
178
- 60: <span class="ruby-keyword kw">end</span>
179
- 61:
180
- 62: <span class="ruby-comment cmt"># set attachments, if any.</span>
181
- 63: <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>
182
- 64: <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>
183
- 65: <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>)
184
- 66: <span class="ruby-identifier">attachment</span>.<span class="ruby-identifier">transfer_encoding</span> = <span class="ruby-value str">&quot;Base64&quot;</span>
185
- 67: <span class="ruby-identifier">attachment</span>.<span class="ruby-identifier">content_type</span> = <span class="ruby-value str">&quot;application/octet-stream&quot;</span>
186
- 68: <span class="ruby-identifier">attachment</span>[<span class="ruby-value str">'Content-Disposition'</span>] = <span class="ruby-node">&quot;attachment; filename=#{at.file_name}&quot;</span>
187
- 69: <span class="ruby-ivar">@tmail</span>.<span class="ruby-identifier">parts</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-identifier">attachment</span>
188
- 70: <span class="ruby-keyword kw">end</span>
189
- 71:
190
- 72: <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>
191
- 73: <span class="ruby-keyword kw">end</span>
192
- </pre>
193
- </div>
194
- </div>
195
- </div>
196
-
197
- <div id="method-M000030" class="method-detail">
198
- <a name="M000030"></a>
199
-
200
- <div class="method-heading">
201
- <a href="#M000030" class="method-signature">
202
- <span class="method-name">deliverable</span><span class="method-args">()</span>
203
- </a>
204
- </div>
205
-
206
- <div class="method-description">
207
- <p>
208
- Returns the ready to be delivered encoded String
209
- </p>
210
- <p><a class="source-toggle" href="#"
211
- onclick="toggleCode('M000030-source');return false;">[Source]</a></p>
212
- <div class="method-source-code" id="M000030-source">
213
- <pre>
214
- <span class="ruby-comment cmt"># File lib/mack-notifier/adapters/tmail.rb, line 18</span>
215
- 18: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">deliverable</span>
216
- 19: <span class="ruby-identifier">transformed</span>.<span class="ruby-identifier">encoded</span>
217
- 20: <span class="ruby-keyword kw">end</span>
218
- </pre>
219
- </div>
220
- </div>
221
- </div>
222
-
223
- <div id="method-M000029" class="method-detail">
224
- <a name="M000029"></a>
225
-
226
- <div class="method-heading">
227
- <a href="#M000029" class="method-signature">
228
- <span class="method-name">transformed</span><span class="method-args">()</span>
229
- </a>
230
- </div>
231
-
232
- <div class="method-description">
233
- <p>
234
- Returns the underlying TMail object. Raises <a
235
- href="../../Errors/UnconvertedNotifier.html">Mack::Errors::UnconvertedNotifier</a>
236
- if the <a href="Tmail.html#M000031">convert</a> method hasn&#8216;t been
237
- called first.
238
- </p>
239
- <p><a class="source-toggle" href="#"
240
- onclick="toggleCode('M000029-source');return false;">[Source]</a></p>
241
- <div class="method-source-code" id="M000029-source">
242
- <pre>
243
- <span class="ruby-comment cmt"># File lib/mack-notifier/adapters/tmail.rb, line 12</span>
244
- 12: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">transformed</span>
245
- 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>
246
- 14: <span class="ruby-ivar">@tmail</span>
247
- 15: <span class="ruby-keyword kw">end</span>
248
- </pre>
249
- </div>
250
- </div>
251
- </div>
252
-
253
-
254
- </div>
255
-
256
-
257
- </div>
258
-
259
-
260
- <div id="validator-badges">
261
- <p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
262
- </div>
263
-
264
- </body>
265
- </html>
@@ -1,270 +0,0 @@
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>&nbsp;&nbsp;
97
- <a href="#M000033">add_io</a>&nbsp;&nbsp;
98
- <a href="#M000035">add_uploaded_file</a>&nbsp;&nbsp;
99
- <a href="#M000032">new</a>&nbsp;&nbsp;
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">&nbsp;[RW]&nbsp;</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">&nbsp;[RW]&nbsp;</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&#8216;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>