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,419 @@
|
|
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>Module: Mack::Notifier::Validatable</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>Module</strong></td>
|
53
|
+
<td class="class-name-in-header">Mack::Notifier::Validatable</td>
|
54
|
+
</tr>
|
55
|
+
<tr class="top-aligned-row">
|
56
|
+
<td><strong>In:</strong></td>
|
57
|
+
<td>
|
58
|
+
<a href="../../../files/lib/mack-notifier/validations_rb.html">
|
59
|
+
lib/mack-notifier/validations.rb
|
60
|
+
</a>
|
61
|
+
<br />
|
62
|
+
</td>
|
63
|
+
</tr>
|
64
|
+
|
65
|
+
</table>
|
66
|
+
</div>
|
67
|
+
<!-- banner header -->
|
68
|
+
|
69
|
+
<div id="bodyContent">
|
70
|
+
|
71
|
+
|
72
|
+
|
73
|
+
<div id="contextContent">
|
74
|
+
|
75
|
+
<div id="description">
|
76
|
+
<p>
|
77
|
+
Includes the validatable gem into your <a
|
78
|
+
href="../Notifier.html">Notifier</a>. <a
|
79
|
+
href="http://validatable.rubyforge.org">validatable.rubyforge.org</a>
|
80
|
+
</p>
|
81
|
+
|
82
|
+
</div>
|
83
|
+
|
84
|
+
|
85
|
+
</div>
|
86
|
+
|
87
|
+
<div id="method-list">
|
88
|
+
<h3 class="section-bar">Methods</h3>
|
89
|
+
|
90
|
+
<div class="name-list">
|
91
|
+
<a href="#M000027">common_notifier_validations</a>
|
92
|
+
<a href="#M000031">deliver</a>
|
93
|
+
<a href="#M000030">deliver!</a>
|
94
|
+
<a href="#M000029">email_validation_regex</a>
|
95
|
+
<a href="#M000026">included</a>
|
96
|
+
<a href="#M000028">validates_email_format_of</a>
|
97
|
+
</div>
|
98
|
+
</div>
|
99
|
+
|
100
|
+
</div>
|
101
|
+
|
102
|
+
|
103
|
+
<!-- if includes -->
|
104
|
+
<div id="includes">
|
105
|
+
<h3 class="section-bar">Included Modules</h3>
|
106
|
+
|
107
|
+
<div id="includes-list">
|
108
|
+
<span class="include-name">::Validatable</span>
|
109
|
+
</div>
|
110
|
+
</div>
|
111
|
+
|
112
|
+
<div id="section">
|
113
|
+
|
114
|
+
|
115
|
+
|
116
|
+
<div id="aliases-list">
|
117
|
+
<h3 class="section-bar">External Aliases</h3>
|
118
|
+
|
119
|
+
<div class="name-list">
|
120
|
+
<table summary="aliases">
|
121
|
+
<tr class="top-aligned-row context-row">
|
122
|
+
<td class="context-item-name">validates_acceptance_of</td>
|
123
|
+
<td>-></td>
|
124
|
+
<td class="context-item-value">validates_is_accepted</td>
|
125
|
+
</tr>
|
126
|
+
<tr class="top-aligned-row context-row">
|
127
|
+
<td> </td>
|
128
|
+
<td colspan="2" class="context-item-desc">
|
129
|
+
Alias the <a href="Validatable.html">Validatable</a> methods to look like
|
130
|
+
DataMapper methods, if that‘s the kind of thing you‘re used to.
|
131
|
+
:)
|
132
|
+
|
133
|
+
</td>
|
134
|
+
</tr>
|
135
|
+
<tr class="top-aligned-row context-row">
|
136
|
+
<td class="context-item-name">validates_confirmation_of</td>
|
137
|
+
<td>-></td>
|
138
|
+
<td class="context-item-value">validates_is_confirmed</td>
|
139
|
+
</tr>
|
140
|
+
<tr class="top-aligned-row context-row">
|
141
|
+
<td class="context-item-name">validates_format_of</td>
|
142
|
+
<td>-></td>
|
143
|
+
<td class="context-item-value">validates_format</td>
|
144
|
+
</tr>
|
145
|
+
<tr class="top-aligned-row context-row">
|
146
|
+
<td class="context-item-name">validates_length_of</td>
|
147
|
+
<td>-></td>
|
148
|
+
<td class="context-item-value">validates_length</td>
|
149
|
+
</tr>
|
150
|
+
<tr class="top-aligned-row context-row">
|
151
|
+
<td class="context-item-name">validates_numericality_of</td>
|
152
|
+
<td>-></td>
|
153
|
+
<td class="context-item-value">validates_is_number</td>
|
154
|
+
</tr>
|
155
|
+
<tr class="top-aligned-row context-row">
|
156
|
+
<td class="context-item-name">validates_presence_of</td>
|
157
|
+
<td>-></td>
|
158
|
+
<td class="context-item-value">validates_present</td>
|
159
|
+
</tr>
|
160
|
+
</table>
|
161
|
+
</div>
|
162
|
+
</div>
|
163
|
+
|
164
|
+
|
165
|
+
|
166
|
+
|
167
|
+
|
168
|
+
<!-- if method_list -->
|
169
|
+
<div id="methods">
|
170
|
+
<h3 class="section-bar">Public Class methods</h3>
|
171
|
+
|
172
|
+
<div id="method-M000027" class="method-detail">
|
173
|
+
<a name="M000027"></a>
|
174
|
+
|
175
|
+
<div class="method-heading">
|
176
|
+
<a href="#M000027" class="method-signature">
|
177
|
+
<span class="method-name">common_notifier_validations</span><span class="method-args">()</span>
|
178
|
+
</a>
|
179
|
+
</div>
|
180
|
+
|
181
|
+
<div class="method-description">
|
182
|
+
<p>
|
183
|
+
Adds common validations to your <a
|
184
|
+
href="../Notifier.html">Mack::Notifier</a> class. These include:
|
185
|
+
</p>
|
186
|
+
<pre>
|
187
|
+
validates_presence_of :to
|
188
|
+
validates_presence_of :from
|
189
|
+
validates_presence_of :subject
|
190
|
+
validates_email_format_of :to
|
191
|
+
validates_email_format_of :from
|
192
|
+
</pre>
|
193
|
+
<p><a class="source-toggle" href="#"
|
194
|
+
onclick="toggleCode('M000027-source');return false;">[Source]</a></p>
|
195
|
+
<div class="method-source-code" id="M000027-source">
|
196
|
+
<pre>
|
197
|
+
<span class="ruby-comment cmt"># File lib/mack-notifier/validations.rb, line 33</span>
|
198
|
+
33: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">common_notifier_validations</span>
|
199
|
+
34: <span class="ruby-identifier">validates_presence_of</span> <span class="ruby-identifier">:to</span>
|
200
|
+
35: <span class="ruby-identifier">validates_presence_of</span> <span class="ruby-identifier">:from</span>
|
201
|
+
36: <span class="ruby-identifier">validates_presence_of</span> <span class="ruby-identifier">:subject</span>
|
202
|
+
37: <span class="ruby-identifier">validates_email_format_of</span> <span class="ruby-identifier">:to</span>
|
203
|
+
38: <span class="ruby-identifier">validates_email_format_of</span> <span class="ruby-identifier">:from</span>
|
204
|
+
39: <span class="ruby-keyword kw">end</span>
|
205
|
+
</pre>
|
206
|
+
</div>
|
207
|
+
</div>
|
208
|
+
</div>
|
209
|
+
|
210
|
+
<div id="method-M000029" class="method-detail">
|
211
|
+
<a name="M000029"></a>
|
212
|
+
|
213
|
+
<div class="method-heading">
|
214
|
+
<a href="#M000029" class="method-signature">
|
215
|
+
<span class="method-name">email_validation_regex</span><span class="method-args">()</span>
|
216
|
+
</a>
|
217
|
+
</div>
|
218
|
+
|
219
|
+
<div class="method-description">
|
220
|
+
<p><a class="source-toggle" href="#"
|
221
|
+
onclick="toggleCode('M000029-source');return false;">[Source]</a></p>
|
222
|
+
<div class="method-source-code" id="M000029-source">
|
223
|
+
<pre>
|
224
|
+
<span class="ruby-comment cmt"># File lib/mack-notifier/validations.rb, line 52</span>
|
225
|
+
52: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">email_validation_regex</span>
|
226
|
+
53: <span class="ruby-identifier">regex</span> = <span class="ruby-value str">"[a-z0-9!\#$\\%&'*+/=?^_`{|}~-]+(?:\\.[a-z0-9!\#$\\%&'*+/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\n"</span>
|
227
|
+
54: <span class="ruby-node">/#{regex.strip}/</span>
|
228
|
+
55: <span class="ruby-keyword kw">end</span>
|
229
|
+
</pre>
|
230
|
+
</div>
|
231
|
+
</div>
|
232
|
+
</div>
|
233
|
+
|
234
|
+
<div id="method-M000026" class="method-detail">
|
235
|
+
<a name="M000026"></a>
|
236
|
+
|
237
|
+
<div class="method-heading">
|
238
|
+
<a href="#M000026" class="method-signature">
|
239
|
+
<span class="method-name">included</span><span class="method-args">(base)</span>
|
240
|
+
</a>
|
241
|
+
</div>
|
242
|
+
|
243
|
+
<div class="method-description">
|
244
|
+
<p><a class="source-toggle" href="#"
|
245
|
+
onclick="toggleCode('M000026-source');return false;">[Source]</a></p>
|
246
|
+
<div class="method-source-code" id="M000026-source">
|
247
|
+
<pre>
|
248
|
+
<span class="ruby-comment cmt"># File lib/mack-notifier/validations.rb, line 7</span>
|
249
|
+
7: <span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">included</span>(<span class="ruby-identifier">base</span>)
|
250
|
+
8: <span class="ruby-identifier">base</span>.<span class="ruby-identifier">instance_eval</span> <span class="ruby-keyword kw">do</span>
|
251
|
+
9: <span class="ruby-identifier">include</span> <span class="ruby-operator">::</span><span class="ruby-constant">Validatable</span>
|
252
|
+
10: <span class="ruby-identifier">alias_method</span> <span class="ruby-value str">"unvalidated_deliver!"</span>, <span class="ruby-value str">"deliver!"</span>
|
253
|
+
11: <span class="ruby-keyword kw">end</span>
|
254
|
+
12:
|
255
|
+
13: <span class="ruby-identifier">base</span>.<span class="ruby-identifier">class_eval</span> <span class="ruby-keyword kw">do</span>
|
256
|
+
14:
|
257
|
+
15: <span class="ruby-keyword kw">class</span> <span class="ruby-operator"><<</span> <span class="ruby-keyword kw">self</span>
|
258
|
+
16:
|
259
|
+
17: <span class="ruby-comment cmt"># Alias the Validatable methods to look like DataMapper methods,</span>
|
260
|
+
18: <span class="ruby-comment cmt"># if that's the kind of thing you're used to. :)</span>
|
261
|
+
19: <span class="ruby-identifier">alias_method</span> <span class="ruby-identifier">:validates_is_accepted</span>, <span class="ruby-identifier">:validates_acceptance_of</span>
|
262
|
+
20: <span class="ruby-identifier">alias_method</span> <span class="ruby-identifier">:validates_is_confirmed</span>, <span class="ruby-identifier">:validates_confirmation_of</span>
|
263
|
+
21: <span class="ruby-identifier">alias_method</span> <span class="ruby-identifier">:validates_format</span>, <span class="ruby-identifier">:validates_format_of</span>
|
264
|
+
22: <span class="ruby-identifier">alias_method</span> <span class="ruby-identifier">:validates_length</span>, <span class="ruby-identifier">:validates_length_of</span>
|
265
|
+
23: <span class="ruby-identifier">alias_method</span> <span class="ruby-identifier">:validates_is_number</span>, <span class="ruby-identifier">:validates_numericality_of</span>
|
266
|
+
24: <span class="ruby-identifier">alias_method</span> <span class="ruby-identifier">:validates_present</span>, <span class="ruby-identifier">:validates_presence_of</span>
|
267
|
+
25:
|
268
|
+
26: <span class="ruby-comment cmt"># Adds common validations to your Mack::Notifier class.</span>
|
269
|
+
27: <span class="ruby-comment cmt"># These include:</span>
|
270
|
+
28: <span class="ruby-comment cmt"># validates_presence_of :to</span>
|
271
|
+
29: <span class="ruby-comment cmt"># validates_presence_of :from</span>
|
272
|
+
30: <span class="ruby-comment cmt"># validates_presence_of :subject</span>
|
273
|
+
31: <span class="ruby-comment cmt"># validates_email_format_of :to</span>
|
274
|
+
32: <span class="ruby-comment cmt"># validates_email_format_of :from</span>
|
275
|
+
33: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">common_notifier_validations</span>
|
276
|
+
34: <span class="ruby-identifier">validates_presence_of</span> <span class="ruby-identifier">:to</span>
|
277
|
+
35: <span class="ruby-identifier">validates_presence_of</span> <span class="ruby-identifier">:from</span>
|
278
|
+
36: <span class="ruby-identifier">validates_presence_of</span> <span class="ruby-identifier">:subject</span>
|
279
|
+
37: <span class="ruby-identifier">validates_email_format_of</span> <span class="ruby-identifier">:to</span>
|
280
|
+
38: <span class="ruby-identifier">validates_email_format_of</span> <span class="ruby-identifier">:from</span>
|
281
|
+
39: <span class="ruby-keyword kw">end</span>
|
282
|
+
40:
|
283
|
+
41: <span class="ruby-comment cmt"># Validates the email format of the column specified against the email_validation_regex method.</span>
|
284
|
+
42: <span class="ruby-comment cmt"># This will drill into arrays as well, if that's what your column is.</span>
|
285
|
+
43: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">validates_email_format_of</span>(<span class="ruby-identifier">column</span>, <span class="ruby-identifier">options</span> = {})
|
286
|
+
44: <span class="ruby-identifier">options</span> = {<span class="ruby-identifier">:logic</span> =<span class="ruby-operator">></span> <span class="ruby-identifier">lambda</span>{
|
287
|
+
45: [<span class="ruby-identifier">send</span>(<span class="ruby-identifier">column</span>)].<span class="ruby-identifier">flatten</span>.<span class="ruby-identifier">each_with_index</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">addr</span>, <span class="ruby-identifier">i</span><span class="ruby-operator">|</span>
|
288
|
+
46: <span class="ruby-identifier">errors</span>.<span class="ruby-identifier">add</span>(<span class="ruby-identifier">column</span>, <span class="ruby-node">"[#{addr}] is not valid"</span>) <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">addr</span>.<span class="ruby-identifier">to_s</span>.<span class="ruby-identifier">downcase</span>.<span class="ruby-identifier">match</span>(<span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">class</span>.<span class="ruby-identifier">email_validation_regex</span>)
|
289
|
+
47: <span class="ruby-keyword kw">end</span>
|
290
|
+
48: }}.<span class="ruby-identifier">merge</span>(<span class="ruby-identifier">options</span>)
|
291
|
+
49: <span class="ruby-identifier">validates_each</span> <span class="ruby-identifier">:to</span>, <span class="ruby-identifier">options</span>
|
292
|
+
50: <span class="ruby-keyword kw">end</span>
|
293
|
+
51:
|
294
|
+
52: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">email_validation_regex</span>
|
295
|
+
53: <span class="ruby-identifier">regex</span> = <span class="ruby-value str">"[a-z0-9!\#$\\%&'*+/=?^_`{|}~-]+(?:\\.[a-z0-9!\#$\\%&'*+/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\n"</span>
|
296
|
+
54: <span class="ruby-node">/#{regex.strip}/</span>
|
297
|
+
55: <span class="ruby-keyword kw">end</span>
|
298
|
+
56:
|
299
|
+
57: <span class="ruby-keyword kw">end</span> <span class="ruby-comment cmt"># class << self</span>
|
300
|
+
58: <span class="ruby-keyword kw">end</span> <span class="ruby-comment cmt"># class_eval</span>
|
301
|
+
59: <span class="ruby-keyword kw">end</span>
|
302
|
+
</pre>
|
303
|
+
</div>
|
304
|
+
</div>
|
305
|
+
</div>
|
306
|
+
|
307
|
+
<div id="method-M000028" class="method-detail">
|
308
|
+
<a name="M000028"></a>
|
309
|
+
|
310
|
+
<div class="method-heading">
|
311
|
+
<a href="#M000028" class="method-signature">
|
312
|
+
<span class="method-name">validates_email_format_of</span><span class="method-args">(column, options = {})</span>
|
313
|
+
</a>
|
314
|
+
</div>
|
315
|
+
|
316
|
+
<div class="method-description">
|
317
|
+
<p>
|
318
|
+
Validates the email format of the column specified against the <a
|
319
|
+
href="Validatable.html#M000029">email_validation_regex</a> method. This
|
320
|
+
will drill into arrays as well, if that‘s what your column is.
|
321
|
+
</p>
|
322
|
+
<p><a class="source-toggle" href="#"
|
323
|
+
onclick="toggleCode('M000028-source');return false;">[Source]</a></p>
|
324
|
+
<div class="method-source-code" id="M000028-source">
|
325
|
+
<pre>
|
326
|
+
<span class="ruby-comment cmt"># File lib/mack-notifier/validations.rb, line 43</span>
|
327
|
+
43: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">validates_email_format_of</span>(<span class="ruby-identifier">column</span>, <span class="ruby-identifier">options</span> = {})
|
328
|
+
44: <span class="ruby-identifier">options</span> = {<span class="ruby-identifier">:logic</span> =<span class="ruby-operator">></span> <span class="ruby-identifier">lambda</span>{
|
329
|
+
45: [<span class="ruby-identifier">send</span>(<span class="ruby-identifier">column</span>)].<span class="ruby-identifier">flatten</span>.<span class="ruby-identifier">each_with_index</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">addr</span>, <span class="ruby-identifier">i</span><span class="ruby-operator">|</span>
|
330
|
+
46: <span class="ruby-identifier">errors</span>.<span class="ruby-identifier">add</span>(<span class="ruby-identifier">column</span>, <span class="ruby-node">"[#{addr}] is not valid"</span>) <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">addr</span>.<span class="ruby-identifier">to_s</span>.<span class="ruby-identifier">downcase</span>.<span class="ruby-identifier">match</span>(<span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">class</span>.<span class="ruby-identifier">email_validation_regex</span>)
|
331
|
+
47: <span class="ruby-keyword kw">end</span>
|
332
|
+
48: }}.<span class="ruby-identifier">merge</span>(<span class="ruby-identifier">options</span>)
|
333
|
+
49: <span class="ruby-identifier">validates_each</span> <span class="ruby-identifier">:to</span>, <span class="ruby-identifier">options</span>
|
334
|
+
50: <span class="ruby-keyword kw">end</span>
|
335
|
+
</pre>
|
336
|
+
</div>
|
337
|
+
</div>
|
338
|
+
</div>
|
339
|
+
|
340
|
+
<h3 class="section-bar">Public Instance methods</h3>
|
341
|
+
|
342
|
+
<div id="method-M000031" class="method-detail">
|
343
|
+
<a name="M000031"></a>
|
344
|
+
|
345
|
+
<div class="method-heading">
|
346
|
+
<a href="#M000031" class="method-signature">
|
347
|
+
<span class="method-name">deliver</span><span class="method-args">(handler = deliver_with)</span>
|
348
|
+
</a>
|
349
|
+
</div>
|
350
|
+
|
351
|
+
<div class="method-description">
|
352
|
+
<p>
|
353
|
+
Returns false if the email is not valid. If the email is valid and an
|
354
|
+
exception is raised when trying to <a
|
355
|
+
href="Validatable.html#M000031">deliver</a> it false is returned and the
|
356
|
+
exception is added to the errors array, with the key :<a
|
357
|
+
href="Validatable.html#M000031">deliver</a>.
|
358
|
+
</p>
|
359
|
+
<p><a class="source-toggle" href="#"
|
360
|
+
onclick="toggleCode('M000031-source');return false;">[Source]</a></p>
|
361
|
+
<div class="method-source-code" id="M000031-source">
|
362
|
+
<pre>
|
363
|
+
<span class="ruby-comment cmt"># File lib/mack-notifier/validations.rb, line 74</span>
|
364
|
+
74: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">deliver</span>(<span class="ruby-identifier">handler</span> = <span class="ruby-identifier">deliver_with</span>)
|
365
|
+
75: <span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">false</span> <span class="ruby-keyword kw">unless</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">valid?</span>
|
366
|
+
76: <span class="ruby-keyword kw">begin</span>
|
367
|
+
77: <span class="ruby-node">"Mack::Notifier::DeliveryHandlers::#{handler.to_s.camelcase}"</span>.<span class="ruby-identifier">constantize</span>.<span class="ruby-identifier">deliver</span>(<span class="ruby-keyword kw">self</span>)
|
368
|
+
78: <span class="ruby-keyword kw">rescue</span> <span class="ruby-constant">Exception</span> =<span class="ruby-operator">></span> <span class="ruby-identifier">e</span>
|
369
|
+
79: <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">errors</span>.<span class="ruby-identifier">add</span>(<span class="ruby-identifier">:deliver</span>, <span class="ruby-identifier">e</span>.<span class="ruby-identifier">message</span>)
|
370
|
+
80: <span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">false</span>
|
371
|
+
81: <span class="ruby-keyword kw">end</span>
|
372
|
+
82: <span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">true</span>
|
373
|
+
83: <span class="ruby-keyword kw">end</span>
|
374
|
+
</pre>
|
375
|
+
</div>
|
376
|
+
</div>
|
377
|
+
</div>
|
378
|
+
|
379
|
+
<div id="method-M000030" class="method-detail">
|
380
|
+
<a name="M000030"></a>
|
381
|
+
|
382
|
+
<div class="method-heading">
|
383
|
+
<a href="#M000030" class="method-signature">
|
384
|
+
<span class="method-name">deliver!</span><span class="method-args">(handler = deliver_with)</span>
|
385
|
+
</a>
|
386
|
+
</div>
|
387
|
+
|
388
|
+
<div class="method-description">
|
389
|
+
<p>
|
390
|
+
Raises a RuntimeError if the email you are trying to <a
|
391
|
+
href="Validatable.html#M000031">deliver</a> is not valid.
|
392
|
+
</p>
|
393
|
+
<p><a class="source-toggle" href="#"
|
394
|
+
onclick="toggleCode('M000030-source');return false;">[Source]</a></p>
|
395
|
+
<div class="method-source-code" id="M000030-source">
|
396
|
+
<pre>
|
397
|
+
<span class="ruby-comment cmt"># File lib/mack-notifier/validations.rb, line 65</span>
|
398
|
+
65: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">deliver!</span>(<span class="ruby-identifier">handler</span> = <span class="ruby-identifier">deliver_with</span>)
|
399
|
+
66: <span class="ruby-identifier">raise</span> <span class="ruby-value str">'Notification is Invalid!'</span> <span class="ruby-keyword kw">unless</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">valid?</span>
|
400
|
+
67: <span class="ruby-identifier">unvalidated_deliver!</span>(<span class="ruby-identifier">handler</span>)
|
401
|
+
68: <span class="ruby-keyword kw">end</span>
|
402
|
+
</pre>
|
403
|
+
</div>
|
404
|
+
</div>
|
405
|
+
</div>
|
406
|
+
|
407
|
+
|
408
|
+
</div>
|
409
|
+
|
410
|
+
|
411
|
+
</div>
|
412
|
+
|
413
|
+
|
414
|
+
<div id="validator-badges">
|
415
|
+
<p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
|
416
|
+
</div>
|
417
|
+
|
418
|
+
</body>
|
419
|
+
</html>
|
@@ -0,0 +1,197 @@
|
|
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>Module: Mack::Paths</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>Module</strong></td>
|
53
|
+
<td class="class-name-in-header">Mack::Paths</td>
|
54
|
+
</tr>
|
55
|
+
<tr class="top-aligned-row">
|
56
|
+
<td><strong>In:</strong></td>
|
57
|
+
<td>
|
58
|
+
<a href="../../files/lib/mack-notifier/paths_rb.html">
|
59
|
+
lib/mack-notifier/paths.rb
|
60
|
+
</a>
|
61
|
+
<br />
|
62
|
+
</td>
|
63
|
+
</tr>
|
64
|
+
|
65
|
+
</table>
|
66
|
+
</div>
|
67
|
+
<!-- banner header -->
|
68
|
+
|
69
|
+
<div id="bodyContent">
|
70
|
+
|
71
|
+
|
72
|
+
|
73
|
+
<div id="contextContent">
|
74
|
+
|
75
|
+
|
76
|
+
|
77
|
+
</div>
|
78
|
+
|
79
|
+
<div id="method-list">
|
80
|
+
<h3 class="section-bar">Methods</h3>
|
81
|
+
|
82
|
+
<div class="name-list">
|
83
|
+
<a href="#M000003">notifier_templates</a>
|
84
|
+
<a href="#M000004">notifier_tests</a>
|
85
|
+
<a href="#M000002">notifiers</a>
|
86
|
+
</div>
|
87
|
+
</div>
|
88
|
+
|
89
|
+
</div>
|
90
|
+
|
91
|
+
|
92
|
+
<!-- if includes -->
|
93
|
+
|
94
|
+
<div id="section">
|
95
|
+
|
96
|
+
|
97
|
+
|
98
|
+
|
99
|
+
|
100
|
+
|
101
|
+
|
102
|
+
|
103
|
+
<!-- if method_list -->
|
104
|
+
<div id="methods">
|
105
|
+
<h3 class="section-bar">Public Class methods</h3>
|
106
|
+
|
107
|
+
<div id="method-M000003" class="method-detail">
|
108
|
+
<a name="M000003"></a>
|
109
|
+
|
110
|
+
<div class="method-heading">
|
111
|
+
<a href="#M000003" class="method-signature">
|
112
|
+
<span class="method-name">notifier_templates</span><span class="method-args">(*args)</span>
|
113
|
+
</a>
|
114
|
+
</div>
|
115
|
+
|
116
|
+
<div class="method-description">
|
117
|
+
<p>
|
118
|
+
The path to the app/notifiers/templates directory.
|
119
|
+
</p>
|
120
|
+
<p><a class="source-toggle" href="#"
|
121
|
+
onclick="toggleCode('M000003-source');return false;">[Source]</a></p>
|
122
|
+
<div class="method-source-code" id="M000003-source">
|
123
|
+
<pre>
|
124
|
+
<span class="ruby-comment cmt"># File lib/mack-notifier/paths.rb, line 10</span>
|
125
|
+
10: <span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">notifier_templates</span>(<span class="ruby-operator">*</span><span class="ruby-identifier">args</span>)
|
126
|
+
11: <span class="ruby-constant">Mack</span><span class="ruby-operator">::</span><span class="ruby-constant">Paths</span>.<span class="ruby-identifier">notifiers</span>(<span class="ruby-value str">"templates"</span>, <span class="ruby-identifier">args</span>)
|
127
|
+
12: <span class="ruby-keyword kw">end</span>
|
128
|
+
</pre>
|
129
|
+
</div>
|
130
|
+
</div>
|
131
|
+
</div>
|
132
|
+
|
133
|
+
<div id="method-M000004" class="method-detail">
|
134
|
+
<a name="M000004"></a>
|
135
|
+
|
136
|
+
<div class="method-heading">
|
137
|
+
<a href="#M000004" class="method-signature">
|
138
|
+
<span class="method-name">notifier_tests</span><span class="method-args">(*args)</span>
|
139
|
+
</a>
|
140
|
+
</div>
|
141
|
+
|
142
|
+
<div class="method-description">
|
143
|
+
<p>
|
144
|
+
The path the test/notifiers directory
|
145
|
+
</p>
|
146
|
+
<p><a class="source-toggle" href="#"
|
147
|
+
onclick="toggleCode('M000004-source');return false;">[Source]</a></p>
|
148
|
+
<div class="method-source-code" id="M000004-source">
|
149
|
+
<pre>
|
150
|
+
<span class="ruby-comment cmt"># File lib/mack-notifier/paths.rb, line 15</span>
|
151
|
+
15: <span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">notifier_tests</span>(<span class="ruby-operator">*</span><span class="ruby-identifier">args</span>)
|
152
|
+
16: <span class="ruby-constant">File</span>.<span class="ruby-identifier">join</span>(<span class="ruby-constant">Mack</span>.<span class="ruby-identifier">root</span>, <span class="ruby-value str">"test"</span>, <span class="ruby-value str">"notifiers"</span>, <span class="ruby-identifier">args</span>)
|
153
|
+
17: <span class="ruby-keyword kw">end</span>
|
154
|
+
</pre>
|
155
|
+
</div>
|
156
|
+
</div>
|
157
|
+
</div>
|
158
|
+
|
159
|
+
<div id="method-M000002" class="method-detail">
|
160
|
+
<a name="M000002"></a>
|
161
|
+
|
162
|
+
<div class="method-heading">
|
163
|
+
<a href="#M000002" class="method-signature">
|
164
|
+
<span class="method-name">notifiers</span><span class="method-args">(*args)</span>
|
165
|
+
</a>
|
166
|
+
</div>
|
167
|
+
|
168
|
+
<div class="method-description">
|
169
|
+
<p>
|
170
|
+
The path to the app/notifiers directory.
|
171
|
+
</p>
|
172
|
+
<p><a class="source-toggle" href="#"
|
173
|
+
onclick="toggleCode('M000002-source');return false;">[Source]</a></p>
|
174
|
+
<div class="method-source-code" id="M000002-source">
|
175
|
+
<pre>
|
176
|
+
<span class="ruby-comment cmt"># File lib/mack-notifier/paths.rb, line 5</span>
|
177
|
+
5: <span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">notifiers</span>(<span class="ruby-operator">*</span><span class="ruby-identifier">args</span>)
|
178
|
+
6: <span class="ruby-constant">File</span>.<span class="ruby-identifier">join</span>(<span class="ruby-constant">Mack</span>.<span class="ruby-identifier">root</span>, <span class="ruby-value str">"app"</span>, <span class="ruby-value str">"notifiers"</span>, <span class="ruby-identifier">args</span>)
|
179
|
+
7: <span class="ruby-keyword kw">end</span>
|
180
|
+
</pre>
|
181
|
+
</div>
|
182
|
+
</div>
|
183
|
+
</div>
|
184
|
+
|
185
|
+
|
186
|
+
</div>
|
187
|
+
|
188
|
+
|
189
|
+
</div>
|
190
|
+
|
191
|
+
|
192
|
+
<div id="validator-badges">
|
193
|
+
<p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
|
194
|
+
</div>
|
195
|
+
|
196
|
+
</body>
|
197
|
+
</html>
|