mail_engine 0.1.6 → 0.1.7
Sign up to get free protection for your applications and to get access to all the features.
- data/.yardoc/checksums +9 -7
- data/.yardoc/objects/ActionMailer/Base/collect_responses_and_parts_order_i.dat +0 -0
- data/.yardoc/objects/ActionMailer/Base/mail_i.dat +0 -0
- data/.yardoc/objects/ActionMailer/Base/origin_mail_i.dat +0 -0
- data/.yardoc/objects/ActionMailer/Base/set_layout_and_partials_i.dat +0 -0
- data/.yardoc/objects/ActionMailer/Base.dat +0 -0
- data/.yardoc/objects/ActionMailer/Collector/custom_i.dat +0 -0
- data/.yardoc/objects/ActionMailer/Collector.dat +0 -0
- data/.yardoc/objects/ActionMailer.dat +0 -0
- data/.yardoc/objects/LiquidView/PROTECTED_ASSIGNS.dat +0 -0
- data/.yardoc/objects/LiquidView/PROTECTED_INSTANCE_VARIABLES.dat +0 -0
- data/.yardoc/objects/LiquidView/call_c.dat +0 -0
- data/.yardoc/objects/LiquidView/compilable_3F_i.dat +0 -0
- data/.yardoc/objects/LiquidView/initialize_i.dat +0 -0
- data/.yardoc/objects/LiquidView/render_i.dat +0 -0
- data/.yardoc/objects/LiquidView.dat +0 -0
- data/.yardoc/objects/MailEngine/ActsAsMailReceiver/ClassMethods/acts_as_mail_receiver_i.dat +0 -0
- data/.yardoc/objects/MailEngine/ActsAsMailReceiver/ClassMethods/check_method_existance_21_i.dat +0 -0
- data/.yardoc/objects/MailEngine/ActsAsMailReceiver/ClassMethods.dat +0 -0
- data/.yardoc/objects/MailEngine/ActsAsMailReceiver.dat +0 -0
- data/.yardoc/objects/MailEngine/Base/_40_40configurations.dat +0 -0
- data/.yardoc/objects/MailEngine/Base/current_config_c.dat +0 -0
- data/.yardoc/objects/MailEngine/Base/send_marketing_mail_c.dat +0 -0
- data/.yardoc/objects/MailEngine/Base.dat +0 -0
- data/.yardoc/objects/MailEngine/Configuration/load_c.dat +0 -0
- data/.yardoc/objects/MailEngine/Configuration.dat +0 -0
- data/.yardoc/objects/MailEngine/CopyMigrations/copy_migrations_i.dat +0 -0
- data/.yardoc/objects/MailEngine/CopyMigrations.dat +0 -0
- data/.yardoc/objects/MailEngine/CopyResources/copy_resources_i.dat +0 -0
- data/.yardoc/objects/MailEngine/CopyResources.dat +0 -0
- data/.yardoc/objects/MailEngine/CreateConfig/create_config_file_i.dat +0 -0
- data/.yardoc/objects/MailEngine/CreateConfig.dat +0 -0
- data/.yardoc/objects/MailEngine/Engine.dat +0 -0
- data/.yardoc/objects/MailEngine/HtmlDocumentAssetsReplacer/check_21_c.dat +0 -0
- data/.yardoc/objects/MailEngine/HtmlDocumentAssetsReplacer/get_resource_url_c.dat +0 -0
- data/.yardoc/objects/MailEngine/HtmlDocumentAssetsReplacer/process_c.dat +0 -0
- data/.yardoc/objects/MailEngine/HtmlDocumentAssetsReplacer/replace_resource_in_html_c.dat +0 -0
- data/.yardoc/objects/MailEngine/HtmlDocumentAssetsReplacer.dat +0 -0
- data/.yardoc/objects/MailEngine/Install/copy_migrations_i.dat +0 -0
- data/.yardoc/objects/MailEngine/Install/copy_resources_i.dat +0 -0
- data/.yardoc/objects/MailEngine/Install/create_config_i.dat +0 -0
- data/.yardoc/objects/MailEngine/Install.dat +0 -0
- data/.yardoc/objects/MailEngine/MailLogSubscriber/deliver_i.dat +0 -0
- data/.yardoc/objects/MailEngine/MailLogSubscriber.dat +0 -0
- data/.yardoc/objects/MailEngine/MailTemplateResolver/find_templates_i.dat +0 -0
- data/.yardoc/objects/MailEngine/MailTemplateResolver/initialize_template_i.dat +0 -0
- data/.yardoc/objects/MailEngine/MailTemplateResolver/normalize_array_i.dat +0 -0
- data/.yardoc/objects/MailEngine/MailTemplateResolver/normalize_path_i.dat +0 -0
- data/.yardoc/objects/MailEngine/MailTemplateResolver/virtual_path_i.dat +0 -0
- data/.yardoc/objects/MailEngine/MailTemplateResolver.dat +0 -0
- data/.yardoc/objects/MailEngine/PLACEHOLDERS_IN_LAYOUT.dat +0 -0
- data/.yardoc/objects/MailEngine/Sendgrid/Base/ClassMethods/sendgrid_header_i.dat +0 -0
- data/.yardoc/objects/MailEngine/Sendgrid/Base/ClassMethods.dat +0 -0
- data/.yardoc/objects/MailEngine/Sendgrid/Base/InstanceMethods.dat +0 -0
- data/.yardoc/objects/MailEngine/Sendgrid/Base.dat +0 -0
- data/.yardoc/objects/MailEngine/Sendgrid/FilterSetting/data_3D_i.dat +0 -0
- data/.yardoc/objects/MailEngine/Sendgrid/FilterSetting/data_i.dat +0 -0
- data/.yardoc/objects/MailEngine/Sendgrid/FilterSetting/initialize_i.dat +0 -0
- data/.yardoc/objects/MailEngine/Sendgrid/FilterSetting/validate_config_21_i.dat +0 -0
- data/.yardoc/objects/MailEngine/Sendgrid/FilterSetting.dat +0 -0
- data/.yardoc/objects/MailEngine/Sendgrid/RestApi/blocks_c.dat +0 -0
- data/.yardoc/objects/MailEngine/Sendgrid/RestApi/bounces_c.dat +0 -0
- data/.yardoc/objects/MailEngine/Sendgrid/RestApi/invalidemails_c.dat +0 -0
- data/.yardoc/objects/MailEngine/Sendgrid/RestApi/spamreports_c.dat +0 -0
- data/.yardoc/objects/MailEngine/Sendgrid/RestApi/stats_c.dat +0 -0
- data/.yardoc/objects/MailEngine/Sendgrid/RestApi.dat +0 -0
- data/.yardoc/objects/MailEngine/Sendgrid/RestApiError.dat +0 -0
- data/.yardoc/objects/MailEngine/Sendgrid/SmtpApi/add_sub_val_i.dat +0 -0
- data/.yardoc/objects/MailEngine/Sendgrid/SmtpApi/add_to_i.dat +0 -0
- data/.yardoc/objects/MailEngine/Sendgrid/SmtpApi/category_i.dat +0 -0
- data/.yardoc/objects/MailEngine/Sendgrid/SmtpApi/filters_i.dat +0 -0
- data/.yardoc/objects/MailEngine/Sendgrid/SmtpApi/initialize_i.dat +0 -0
- data/.yardoc/objects/MailEngine/Sendgrid/SmtpApi/set_send_to_i.dat +0 -0
- data/.yardoc/objects/MailEngine/Sendgrid/SmtpApi/set_unique_args_i.dat +0 -0
- data/.yardoc/objects/MailEngine/Sendgrid/SmtpApi/to_hash_i.dat +0 -0
- data/.yardoc/objects/MailEngine/Sendgrid/SmtpApi/to_json_i.dat +0 -0
- data/.yardoc/objects/MailEngine/Sendgrid/SmtpApi/to_s_i.dat +0 -0
- data/.yardoc/objects/MailEngine/Sendgrid/SmtpApi.dat +0 -0
- data/.yardoc/objects/MailEngine/Sendgrid.dat +0 -0
- data/.yardoc/objects/MailEngine/VERSION.dat +0 -0
- data/.yardoc/objects/MailEngine/ZipProcessor/extract_all_files_c.dat +0 -0
- data/.yardoc/objects/MailEngine/ZipProcessor.dat +0 -0
- data/.yardoc/objects/MailEngine.dat +0 -0
- data/.yardoc/objects/root.dat +0 -0
- data/.yardoc/proxy_types +0 -0
- data/Gemfile +0 -1
- data/VERSION +1 -1
- data/app/controllers/mail_engine/application_controller.rb +0 -2
- data/doc/ActionMailer/Base.html +48 -4
- data/doc/ActionMailer/Collector.html +11 -11
- data/doc/ActionMailer.html +1 -1
- data/doc/LiquidView.html +453 -0
- data/doc/MailEngine/ActsAsMailReceiver/ClassMethods.html +1 -1
- data/doc/MailEngine/ActsAsMailReceiver.html +1 -1
- data/doc/MailEngine/Base.html +14 -12
- data/doc/MailEngine/Configuration.html +1 -1
- data/doc/MailEngine/CopyMigrations.html +1 -1
- data/doc/MailEngine/CopyResources.html +1 -1
- data/doc/MailEngine/CreateConfig.html +1 -1
- data/doc/MailEngine/Engine.html +1 -1
- data/doc/MailEngine/HtmlDocumentAssetsReplacer.html +1 -1
- data/doc/MailEngine/Install.html +1 -1
- data/doc/MailEngine/MailLogSubscriber.html +1 -1
- data/doc/MailEngine/MailTemplateResolver.html +502 -0
- data/doc/MailEngine/Sendgrid/Base/ClassMethods.html +1 -1
- data/doc/MailEngine/Sendgrid/Base/InstanceMethods.html +1 -1
- data/doc/MailEngine/Sendgrid/Base.html +1 -1
- data/doc/MailEngine/Sendgrid/FilterSetting.html +1 -1
- data/doc/MailEngine/Sendgrid/RestApi.html +1 -1
- data/doc/MailEngine/Sendgrid/RestApiError.html +1 -1
- data/doc/MailEngine/Sendgrid/SmtpApi.html +99 -30
- data/doc/MailEngine/Sendgrid.html +1 -1
- data/doc/MailEngine/ZipProcessor.html +1 -1
- data/doc/MailEngine.html +3 -3
- data/doc/_index.html +25 -5
- data/doc/class_list.html +1 -1
- data/doc/file.README.html +70 -2
- data/doc/index.html +70 -2
- data/doc/method_list.html +88 -8
- data/doc/top-level-namespace.html +3 -1
- data/lib/mail_engine/action_mailer_patch.rb +2 -2
- data/lib/mail_engine/engine.rb +3 -7
- data/mail_engine.gemspec +18 -5
- data/test/functional/user_mailer_test.rb +2 -5
- metadata +27 -25
@@ -0,0 +1,502 @@
|
|
1
|
+
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
2
|
+
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
3
|
+
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
4
|
+
<head>
|
5
|
+
<meta name="Content-Type" content="text/html; charset=utf-8" />
|
6
|
+
<title>Class: MailEngine::MailTemplateResolver</title>
|
7
|
+
<link rel="stylesheet" href="../css/style.css" type="text/css" media="screen" charset="utf-8" />
|
8
|
+
<link rel="stylesheet" href="../css/common.css" type="text/css" media="screen" charset="utf-8" />
|
9
|
+
|
10
|
+
<script type="text/javascript" charset="utf-8">
|
11
|
+
relpath = '..';
|
12
|
+
if (relpath != '') relpath += '/';
|
13
|
+
</script>
|
14
|
+
<script type="text/javascript" charset="utf-8" src="../js/jquery.js"></script>
|
15
|
+
<script type="text/javascript" charset="utf-8" src="../js/app.js"></script>
|
16
|
+
|
17
|
+
</head>
|
18
|
+
<body>
|
19
|
+
<script type="text/javascript" charset="utf-8">
|
20
|
+
if (window.top.frames.main) document.body.className = 'frames';
|
21
|
+
</script>
|
22
|
+
|
23
|
+
<div id="header">
|
24
|
+
<div id="menu">
|
25
|
+
|
26
|
+
<a href="../_index.html">Index (M)</a> »
|
27
|
+
<span class='title'><span class='object_link'><a href="../MailEngine.html" title="MailEngine (module)">MailEngine</a></span></span>
|
28
|
+
»
|
29
|
+
<span class="title">MailTemplateResolver</span>
|
30
|
+
|
31
|
+
|
32
|
+
<div class="noframes"><span class="title">(</span><a href="." target="_top">no frames</a><span class="title">)</span></div>
|
33
|
+
</div>
|
34
|
+
|
35
|
+
<div id="search">
|
36
|
+
<a id="class_list_link" href="#">Class List</a>
|
37
|
+
<a id="method_list_link" href="#">Method List</a>
|
38
|
+
<a id ="file_list_link" href="#">File List</a>
|
39
|
+
</div>
|
40
|
+
|
41
|
+
<div class="clear"></div>
|
42
|
+
</div>
|
43
|
+
|
44
|
+
<iframe id="search_frame"></iframe>
|
45
|
+
|
46
|
+
<div id="content"><h1>Class: MailEngine::MailTemplateResolver
|
47
|
+
|
48
|
+
|
49
|
+
|
50
|
+
</h1>
|
51
|
+
|
52
|
+
<dl class="box">
|
53
|
+
|
54
|
+
<dt class="r1">Inherits:</dt>
|
55
|
+
<dd class="r1">
|
56
|
+
<span class="inheritName">ActionView::Resolver</span>
|
57
|
+
|
58
|
+
<ul class="fullTree">
|
59
|
+
<li>Object</li>
|
60
|
+
|
61
|
+
<li class="next">ActionView::Resolver</li>
|
62
|
+
|
63
|
+
<li class="next">MailEngine::MailTemplateResolver</li>
|
64
|
+
|
65
|
+
</ul>
|
66
|
+
<a href="#" class="inheritanceTree">show all</a>
|
67
|
+
|
68
|
+
</dd>
|
69
|
+
|
70
|
+
|
71
|
+
|
72
|
+
|
73
|
+
|
74
|
+
|
75
|
+
<dt class="r2">Includes:</dt>
|
76
|
+
<dd class="r2">Singleton</dd>
|
77
|
+
|
78
|
+
|
79
|
+
|
80
|
+
|
81
|
+
|
82
|
+
<dt class="r1 last">Defined in:</dt>
|
83
|
+
<dd class="r1 last">lib/mail_engine/mail_template_resolver.rb</dd>
|
84
|
+
|
85
|
+
</dl>
|
86
|
+
<div class="clear"></div>
|
87
|
+
|
88
|
+
<h2>Overview</h2><div class="docstring">
|
89
|
+
<div class="discussion">
|
90
|
+
<p>
|
91
|
+
path resolver, used for find template by provided path.
|
92
|
+
</p>
|
93
|
+
|
94
|
+
|
95
|
+
</div>
|
96
|
+
</div>
|
97
|
+
<div class="tags">
|
98
|
+
|
99
|
+
</div>
|
100
|
+
|
101
|
+
|
102
|
+
|
103
|
+
|
104
|
+
|
105
|
+
<h2>
|
106
|
+
Instance Method Summary
|
107
|
+
<small>(<a href="#" class="summary_toggle">collapse</a>)</small>
|
108
|
+
</h2>
|
109
|
+
|
110
|
+
<ul class="summary">
|
111
|
+
|
112
|
+
<li class="public ">
|
113
|
+
<span class="summary_signature">
|
114
|
+
|
115
|
+
<a href="#find_templates-instance_method" title="#find_templates (instance method)">- (Object) <strong>find_templates</strong>(name, prefix, partial, details) </a>
|
116
|
+
|
117
|
+
|
118
|
+
|
119
|
+
</span>
|
120
|
+
|
121
|
+
|
122
|
+
|
123
|
+
|
124
|
+
|
125
|
+
|
126
|
+
|
127
|
+
|
128
|
+
<span class="summary_desc"><div class='inline'></div></span>
|
129
|
+
|
130
|
+
</li>
|
131
|
+
|
132
|
+
|
133
|
+
<li class="public ">
|
134
|
+
<span class="summary_signature">
|
135
|
+
|
136
|
+
<a href="#initialize_template-instance_method" title="#initialize_template (instance method)">- (Object) <strong>initialize_template</strong>(record) </a>
|
137
|
+
|
138
|
+
|
139
|
+
|
140
|
+
</span>
|
141
|
+
|
142
|
+
|
143
|
+
|
144
|
+
|
145
|
+
|
146
|
+
|
147
|
+
|
148
|
+
|
149
|
+
<span class="summary_desc"><div class='inline'><p>
|
150
|
+
Initialize an ActionView::Template object based on the record found.
|
151
|
+
</p>
|
152
|
+
</div></span>
|
153
|
+
|
154
|
+
</li>
|
155
|
+
|
156
|
+
|
157
|
+
<li class="public ">
|
158
|
+
<span class="summary_signature">
|
159
|
+
|
160
|
+
<a href="#normalize_array-instance_method" title="#normalize_array (instance method)">- (Object) <strong>normalize_array</strong>(array) </a>
|
161
|
+
|
162
|
+
|
163
|
+
|
164
|
+
</span>
|
165
|
+
|
166
|
+
|
167
|
+
|
168
|
+
|
169
|
+
|
170
|
+
|
171
|
+
|
172
|
+
|
173
|
+
<span class="summary_desc"><div class='inline'><p>
|
174
|
+
Normalize arrays by converting all symbols to strings.
|
175
|
+
</p>
|
176
|
+
</div></span>
|
177
|
+
|
178
|
+
</li>
|
179
|
+
|
180
|
+
|
181
|
+
<li class="public ">
|
182
|
+
<span class="summary_signature">
|
183
|
+
|
184
|
+
<a href="#normalize_path-instance_method" title="#normalize_path (instance method)">- (Object) <strong>normalize_path</strong>(name, prefix) </a>
|
185
|
+
|
186
|
+
|
187
|
+
|
188
|
+
</span>
|
189
|
+
|
190
|
+
|
191
|
+
|
192
|
+
|
193
|
+
|
194
|
+
|
195
|
+
|
196
|
+
|
197
|
+
<span class="summary_desc"><div class='inline'><p>
|
198
|
+
Normalize name and prefix, so the tuple ["index",
|
199
|
+
"users"] becomes "users/index" and the tuple
|
200
|
+
["template", nil] becomes "template".
|
201
|
+
</p>
|
202
|
+
</div></span>
|
203
|
+
|
204
|
+
</li>
|
205
|
+
|
206
|
+
|
207
|
+
<li class="public ">
|
208
|
+
<span class="summary_signature">
|
209
|
+
|
210
|
+
<a href="#virtual_path-instance_method" title="#virtual_path (instance method)">- (Object) <strong>virtual_path</strong>(path, partial) </a>
|
211
|
+
|
212
|
+
|
213
|
+
|
214
|
+
</span>
|
215
|
+
|
216
|
+
|
217
|
+
|
218
|
+
|
219
|
+
|
220
|
+
|
221
|
+
|
222
|
+
|
223
|
+
<span class="summary_desc"><div class='inline'><p>
|
224
|
+
Make paths as "users/user" become "users/_user" for
|
225
|
+
partials.
|
226
|
+
</p>
|
227
|
+
</div></span>
|
228
|
+
|
229
|
+
</li>
|
230
|
+
|
231
|
+
|
232
|
+
</ul>
|
233
|
+
|
234
|
+
|
235
|
+
|
236
|
+
|
237
|
+
|
238
|
+
|
239
|
+
<div id="instance_method_details" class="method_details_list">
|
240
|
+
<h2>Instance Method Details</h2>
|
241
|
+
|
242
|
+
|
243
|
+
<div class="method_details first">
|
244
|
+
<p class="signature first" id="find_templates-instance_method">
|
245
|
+
|
246
|
+
- (<tt>Object</tt>) <strong>find_templates</strong>(name, prefix, partial, details)
|
247
|
+
|
248
|
+
|
249
|
+
|
250
|
+
</p><table class="source_code">
|
251
|
+
<tr>
|
252
|
+
<td>
|
253
|
+
<pre class="lines">
|
254
|
+
|
255
|
+
|
256
|
+
9
|
257
|
+
10
|
258
|
+
11
|
259
|
+
12
|
260
|
+
13
|
261
|
+
14
|
262
|
+
15
|
263
|
+
16
|
264
|
+
17
|
265
|
+
18
|
266
|
+
19
|
267
|
+
20
|
268
|
+
21
|
269
|
+
22
|
270
|
+
23</pre>
|
271
|
+
</td>
|
272
|
+
<td>
|
273
|
+
<pre class="code"><span class="info file"># File 'lib/mail_engine/mail_template_resolver.rb', line 9</span>
|
274
|
+
|
275
|
+
<span class='def def kw'>def</span> <span class='find_templates identifier id'>find_templates</span><span class='lparen token'>(</span><span class='name identifier id'>name</span><span class='comma token'>,</span> <span class='prefix identifier id'>prefix</span><span class='comma token'>,</span> <span class='partial identifier id'>partial</span><span class='comma token'>,</span> <span class='details identifier id'>details</span><span class='rparen token'>)</span>
|
276
|
+
<span class='template_path_and_name identifier id'>template_path_and_name</span> <span class='assign token'>=</span> <span class='prefix identifier id'>prefix</span><span class='dot token'>.</span><span class='include? fid id'>include?</span><span class='lparen token'>(</span><span class='string val'>"mail_engine/mail_dispatcher"</span><span class='rparen token'>)</span> <span class='question op'>?</span> <span class='normalize_path identifier id'>normalize_path</span><span class='lparen token'>(</span><span class='name identifier id'>name</span><span class='comma token'>,</span> <span class='nil nil kw'>nil</span><span class='rparen token'>)</span> <span class='colon op'>:</span> <span class='normalize_path identifier id'>normalize_path</span><span class='lparen token'>(</span><span class='name identifier id'>name</span><span class='comma token'>,</span> <span class='prefix identifier id'>prefix</span><span class='rparen token'>)</span>
|
277
|
+
|
278
|
+
<span class='conditions identifier id'>conditions</span> <span class='assign token'>=</span> <span class='lbrace token'>{</span>
|
279
|
+
<span class='symbol val'>:path</span> <span class='assign token'>=</span><span class='gt op'>></span> <span class='template_path_and_name identifier id'>template_path_and_name</span><span class='comma token'>,</span>
|
280
|
+
<span class='symbol val'>:locale</span> <span class='assign token'>=</span><span class='gt op'>></span> <span class='normalize_array identifier id'>normalize_array</span><span class='lparen token'>(</span><span class='details identifier id'>details</span><span class='lbrack token'>[</span><span class='symbol val'>:locale</span><span class='rbrack token'>]</span><span class='rparen token'>)</span><span class='dot token'>.</span><span class='first identifier id'>first</span><span class='comma token'>,</span>
|
281
|
+
<span class='symbol val'>:format</span> <span class='assign token'>=</span><span class='gt op'>></span> <span class='normalize_array identifier id'>normalize_array</span><span class='lparen token'>(</span><span class='details identifier id'>details</span><span class='lbrack token'>[</span><span class='symbol val'>:formats</span><span class='rbrack token'>]</span><span class='rparen token'>)</span><span class='dot token'>.</span><span class='first identifier id'>first</span><span class='comma token'>,</span>
|
282
|
+
<span class='symbol val'>:handler</span> <span class='assign token'>=</span><span class='gt op'>></span> <span class='normalize_array identifier id'>normalize_array</span><span class='lparen token'>(</span><span class='details identifier id'>details</span><span class='lbrack token'>[</span><span class='symbol val'>:handlers</span><span class='rbrack token'>]</span><span class='rparen token'>)</span><span class='comma token'>,</span>
|
283
|
+
<span class='symbol val'>:partial</span> <span class='assign token'>=</span><span class='gt op'>></span> <span class='partial identifier id'>partial</span> <span class='orop op'>||</span> <span class='false false kw'>false</span>
|
284
|
+
<span class='rbrace token'>}</span>
|
285
|
+
|
286
|
+
<span class='MailTemplate constant id'>MailTemplate</span><span class='dot token'>.</span><span class='where identifier id'>where</span><span class='lparen token'>(</span><span class='conditions identifier id'>conditions</span><span class='rparen token'>)</span><span class='dot token'>.</span><span class='map identifier id'>map</span> <span class='do do kw'>do</span> <span class='bitor op'>|</span><span class='record identifier id'>record</span><span class='bitor op'>|</span>
|
287
|
+
<span class='initialize_template identifier id'>initialize_template</span><span class='lparen token'>(</span><span class='record identifier id'>record</span><span class='rparen token'>)</span>
|
288
|
+
<span class='end end kw'>end</span>
|
289
|
+
<span class='end end kw'>end</span>
|
290
|
+
</pre>
|
291
|
+
</td>
|
292
|
+
</tr>
|
293
|
+
</table>
|
294
|
+
</div>
|
295
|
+
|
296
|
+
<div class="method_details ">
|
297
|
+
<p class="signature " id="initialize_template-instance_method">
|
298
|
+
|
299
|
+
- (<tt>Object</tt>) <strong>initialize_template</strong>(record)
|
300
|
+
|
301
|
+
|
302
|
+
|
303
|
+
</p><div class="docstring">
|
304
|
+
<div class="discussion">
|
305
|
+
<p>
|
306
|
+
Initialize an ActionView::Template object based on the record found.
|
307
|
+
</p>
|
308
|
+
|
309
|
+
|
310
|
+
</div>
|
311
|
+
</div>
|
312
|
+
<div class="tags">
|
313
|
+
|
314
|
+
</div><table class="source_code">
|
315
|
+
<tr>
|
316
|
+
<td>
|
317
|
+
<pre class="lines">
|
318
|
+
|
319
|
+
|
320
|
+
37
|
321
|
+
38
|
322
|
+
39
|
323
|
+
40
|
324
|
+
41
|
325
|
+
42
|
326
|
+
43
|
327
|
+
44
|
328
|
+
45
|
329
|
+
46
|
330
|
+
47
|
331
|
+
48
|
332
|
+
49
|
333
|
+
50</pre>
|
334
|
+
</td>
|
335
|
+
<td>
|
336
|
+
<pre class="code"><span class="info file"># File 'lib/mail_engine/mail_template_resolver.rb', line 37</span>
|
337
|
+
|
338
|
+
<span class='def def kw'>def</span> <span class='initialize_template identifier id'>initialize_template</span><span class='lparen token'>(</span><span class='record identifier id'>record</span><span class='rparen token'>)</span>
|
339
|
+
<span class='source identifier id'>source</span> <span class='assign token'>=</span> <span class='record identifier id'>record</span><span class='dot token'>.</span><span class='body identifier id'>body</span>
|
340
|
+
|
341
|
+
<span class='identifier identifier id'>identifier</span> <span class='assign token'>=</span> <span class='dstring node'>"mail template - #{record.id} - #{record.path.inspect}"</span>
|
342
|
+
<span class='handler identifier id'>handler</span> <span class='assign token'>=</span> <span class='ActionView constant id'>ActionView</span><span class='colon2 op'>::</span><span class='Template constant id'>Template</span><span class='dot token'>.</span><span class='registered_template_handler identifier id'>registered_template_handler</span><span class='lparen token'>(</span><span class='record identifier id'>record</span><span class='dot token'>.</span><span class='handler identifier id'>handler</span><span class='rparen token'>)</span>
|
343
|
+
|
344
|
+
<span class='details identifier id'>details</span> <span class='assign token'>=</span> <span class='lbrace token'>{</span>
|
345
|
+
<span class='symbol val'>:format</span> <span class='assign token'>=</span><span class='gt op'>></span> <span class='Mime constant id'>Mime</span><span class='lbrack token'>[</span><span class='record identifier id'>record</span><span class='dot token'>.</span><span class='format identifier id'>format</span><span class='rbrack token'>]</span><span class='comma token'>,</span>
|
346
|
+
<span class='symbol val'>:updated_at</span> <span class='assign token'>=</span><span class='gt op'>></span> <span class='record identifier id'>record</span><span class='dot token'>.</span><span class='updated_at identifier id'>updated_at</span><span class='comma token'>,</span>
|
347
|
+
<span class='symbol val'>:virtual_path</span> <span class='assign token'>=</span><span class='gt op'>></span> <span class='virtual_path identifier id'>virtual_path</span><span class='lparen token'>(</span><span class='record identifier id'>record</span><span class='dot token'>.</span><span class='path identifier id'>path</span><span class='comma token'>,</span> <span class='record identifier id'>record</span><span class='dot token'>.</span><span class='partial identifier id'>partial</span><span class='rparen token'>)</span>
|
348
|
+
<span class='rbrace token'>}</span>
|
349
|
+
|
350
|
+
<span class='ActionView constant id'>ActionView</span><span class='colon2 op'>::</span><span class='Template constant id'>Template</span><span class='dot token'>.</span><span class='new identifier id'>new</span><span class='lparen token'>(</span><span class='source identifier id'>source</span><span class='comma token'>,</span> <span class='identifier identifier id'>identifier</span><span class='comma token'>,</span> <span class='handler identifier id'>handler</span><span class='comma token'>,</span> <span class='details identifier id'>details</span><span class='rparen token'>)</span>
|
351
|
+
<span class='end end kw'>end</span>
|
352
|
+
</pre>
|
353
|
+
</td>
|
354
|
+
</tr>
|
355
|
+
</table>
|
356
|
+
</div>
|
357
|
+
|
358
|
+
<div class="method_details ">
|
359
|
+
<p class="signature " id="normalize_array-instance_method">
|
360
|
+
|
361
|
+
- (<tt>Object</tt>) <strong>normalize_array</strong>(array)
|
362
|
+
|
363
|
+
|
364
|
+
|
365
|
+
</p><div class="docstring">
|
366
|
+
<div class="discussion">
|
367
|
+
<p>
|
368
|
+
Normalize arrays by converting all symbols to strings.
|
369
|
+
</p>
|
370
|
+
|
371
|
+
|
372
|
+
</div>
|
373
|
+
</div>
|
374
|
+
<div class="tags">
|
375
|
+
|
376
|
+
</div><table class="source_code">
|
377
|
+
<tr>
|
378
|
+
<td>
|
379
|
+
<pre class="lines">
|
380
|
+
|
381
|
+
|
382
|
+
32
|
383
|
+
33
|
384
|
+
34</pre>
|
385
|
+
</td>
|
386
|
+
<td>
|
387
|
+
<pre class="code"><span class="info file"># File 'lib/mail_engine/mail_template_resolver.rb', line 32</span>
|
388
|
+
|
389
|
+
<span class='def def kw'>def</span> <span class='normalize_array identifier id'>normalize_array</span><span class='lparen token'>(</span><span class='array identifier id'>array</span><span class='rparen token'>)</span>
|
390
|
+
<span class='array identifier id'>array</span><span class='dot token'>.</span><span class='map identifier id'>map</span><span class='lparen token'>(</span><span class='bitand op'>&</span><span class='symbol val'>:to_s</span><span class='rparen token'>)</span>
|
391
|
+
<span class='end end kw'>end</span>
|
392
|
+
</pre>
|
393
|
+
</td>
|
394
|
+
</tr>
|
395
|
+
</table>
|
396
|
+
</div>
|
397
|
+
|
398
|
+
<div class="method_details ">
|
399
|
+
<p class="signature " id="normalize_path-instance_method">
|
400
|
+
|
401
|
+
- (<tt>Object</tt>) <strong>normalize_path</strong>(name, prefix)
|
402
|
+
|
403
|
+
|
404
|
+
|
405
|
+
</p><div class="docstring">
|
406
|
+
<div class="discussion">
|
407
|
+
<p>
|
408
|
+
Normalize name and prefix, so the tuple ["index",
|
409
|
+
"users"] becomes "users/index" and the tuple
|
410
|
+
["template", nil] becomes "template".
|
411
|
+
</p>
|
412
|
+
|
413
|
+
|
414
|
+
</div>
|
415
|
+
</div>
|
416
|
+
<div class="tags">
|
417
|
+
|
418
|
+
</div><table class="source_code">
|
419
|
+
<tr>
|
420
|
+
<td>
|
421
|
+
<pre class="lines">
|
422
|
+
|
423
|
+
|
424
|
+
27
|
425
|
+
28
|
426
|
+
29</pre>
|
427
|
+
</td>
|
428
|
+
<td>
|
429
|
+
<pre class="code"><span class="info file"># File 'lib/mail_engine/mail_template_resolver.rb', line 27</span>
|
430
|
+
|
431
|
+
<span class='def def kw'>def</span> <span class='normalize_path identifier id'>normalize_path</span><span class='lparen token'>(</span><span class='name identifier id'>name</span><span class='comma token'>,</span> <span class='prefix identifier id'>prefix</span><span class='rparen token'>)</span>
|
432
|
+
<span class='prefix identifier id'>prefix</span><span class='dot token'>.</span><span class='present? fid id'>present?</span> <span class='integer val'>? </span><span class='dstring node'>"#{prefix}/#{name}"</span> <span class='colon op'>:</span> <span class='name identifier id'>name</span>
|
433
|
+
<span class='end end kw'>end</span>
|
434
|
+
</pre>
|
435
|
+
</td>
|
436
|
+
</tr>
|
437
|
+
</table>
|
438
|
+
</div>
|
439
|
+
|
440
|
+
<div class="method_details ">
|
441
|
+
<p class="signature " id="virtual_path-instance_method">
|
442
|
+
|
443
|
+
- (<tt>Object</tt>) <strong>virtual_path</strong>(path, partial)
|
444
|
+
|
445
|
+
|
446
|
+
|
447
|
+
</p><div class="docstring">
|
448
|
+
<div class="discussion">
|
449
|
+
<p>
|
450
|
+
Make paths as "users/user" become "users/_user" for
|
451
|
+
partials.
|
452
|
+
</p>
|
453
|
+
|
454
|
+
|
455
|
+
</div>
|
456
|
+
</div>
|
457
|
+
<div class="tags">
|
458
|
+
|
459
|
+
</div><table class="source_code">
|
460
|
+
<tr>
|
461
|
+
<td>
|
462
|
+
<pre class="lines">
|
463
|
+
|
464
|
+
|
465
|
+
53
|
466
|
+
54
|
467
|
+
55
|
468
|
+
56
|
469
|
+
57
|
470
|
+
58
|
471
|
+
59
|
472
|
+
60</pre>
|
473
|
+
</td>
|
474
|
+
<td>
|
475
|
+
<pre class="code"><span class="info file"># File 'lib/mail_engine/mail_template_resolver.rb', line 53</span>
|
476
|
+
|
477
|
+
<span class='def def kw'>def</span> <span class='virtual_path identifier id'>virtual_path</span><span class='lparen token'>(</span><span class='path identifier id'>path</span><span class='comma token'>,</span> <span class='partial identifier id'>partial</span><span class='rparen token'>)</span>
|
478
|
+
<span class='return return kw'>return</span> <span class='path identifier id'>path</span> <span class='unless unless_mod kw'>unless</span> <span class='partial identifier id'>partial</span>
|
479
|
+
<span class='if if kw'>if</span> <span class='index identifier id'>index</span> <span class='assign token'>=</span> <span class='path identifier id'>path</span><span class='dot token'>.</span><span class='rindex identifier id'>rindex</span><span class='lparen token'>(</span><span class='string val'>"/"</span><span class='rparen token'>)</span>
|
480
|
+
<span class='path identifier id'>path</span><span class='dot token'>.</span><span class='insert identifier id'>insert</span><span class='lparen token'>(</span><span class='index identifier id'>index</span> <span class='plus op'>+</span> <span class='integer val'>1</span><span class='comma token'>,</span> <span class='string val'>"_"</span><span class='rparen token'>)</span>
|
481
|
+
<span class='else else kw'>else</span>
|
482
|
+
<span class='dstring node'>"_#{path}"</span>
|
483
|
+
<span class='end end kw'>end</span>
|
484
|
+
<span class='end end kw'>end</span>
|
485
|
+
</pre>
|
486
|
+
</td>
|
487
|
+
</tr>
|
488
|
+
</table>
|
489
|
+
</div>
|
490
|
+
|
491
|
+
</div>
|
492
|
+
|
493
|
+
</div>
|
494
|
+
|
495
|
+
<div id="footer">
|
496
|
+
Generated on Mon Mar 14 22:31:44 2011 by
|
497
|
+
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
498
|
+
0.6.4 (ruby-1.8.7).
|
499
|
+
</div>
|
500
|
+
|
501
|
+
</body>
|
502
|
+
</html>
|
@@ -141,7 +141,7 @@
|
|
141
141
|
</div>
|
142
142
|
|
143
143
|
<div id="footer">
|
144
|
-
Generated on
|
144
|
+
Generated on Mon Mar 14 22:31:45 2011 by
|
145
145
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
146
146
|
0.6.4 (ruby-1.8.7).
|
147
147
|
</div>
|
@@ -248,7 +248,7 @@ Returns the value of attribute data
|
|
248
248
|
</div>
|
249
249
|
|
250
250
|
<div id="footer">
|
251
|
-
Generated on
|
251
|
+
Generated on Mon Mar 14 22:31:44 2011 by
|
252
252
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
253
253
|
0.6.4 (ruby-1.8.7).
|
254
254
|
</div>
|
@@ -467,7 +467,7 @@
|
|
467
467
|
</div>
|
468
468
|
|
469
469
|
<div id="footer">
|
470
|
-
Generated on
|
470
|
+
Generated on Mon Mar 14 22:31:45 2011 by
|
471
471
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
472
472
|
0.6.4 (ruby-1.8.7).
|
473
473
|
</div>
|