mbrao 1.4.4 → 1.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.rubocop.yml +29 -0
- data/.travis.yml +3 -4
- data/CHANGELOG.md +5 -0
- data/Gemfile +4 -4
- data/doc/ActionView.html +125 -0
- data/doc/ActionView/Template.html +140 -0
- data/doc/ActionView/Template/Handlers.html +3 -3
- data/doc/ActionView/Template/Handlers/MbraoTemplate.html +26 -26
- data/doc/HTML.html +2 -2
- data/doc/HTML/Pipeline.html +2 -2
- data/doc/HTML/Pipeline/KramdownFilter.html +4 -4
- data/doc/Mbrao.html +3 -3
- data/doc/Mbrao/Author.html +29 -29
- data/doc/Mbrao/Content.html +1977 -3644
- data/doc/Mbrao/ContentInterface.html +817 -0
- data/doc/Mbrao/ContentInterface/ClassMethods.html +388 -0
- data/doc/Mbrao/Exceptions.html +1 -1
- data/doc/Mbrao/Exceptions/InvalidDate.html +1 -1
- data/doc/Mbrao/Exceptions/InvalidMetadata.html +1 -1
- data/doc/Mbrao/Exceptions/Parsing.html +1 -1
- data/doc/Mbrao/Exceptions/Rendering.html +1 -1
- data/doc/Mbrao/Exceptions/UnavailableLocalization.html +1 -1
- data/doc/Mbrao/Exceptions/Unimplemented.html +1 -1
- data/doc/Mbrao/Exceptions/UnknownEngine.html +1 -1
- data/doc/Mbrao/Parser.html +12 -12
- data/doc/Mbrao/ParserInterface.html +134 -0
- data/doc/Mbrao/ParserInterface/ClassMethods.html +1724 -0
- data/doc/Mbrao/ParserValidations.html +134 -0
- data/doc/Mbrao/ParserValidations/ClassMethods.html +348 -0
- data/doc/Mbrao/ParsingEngines.html +1 -1
- data/doc/Mbrao/ParsingEngines/Base.html +4 -4
- data/doc/Mbrao/ParsingEngines/PlainText.html +25 -15
- data/doc/Mbrao/RenderingEngines.html +1 -1
- data/doc/Mbrao/RenderingEngines/Base.html +2 -2
- data/doc/Mbrao/RenderingEngines/HtmlPipeline.html +173 -169
- data/doc/Mbrao/Version.html +3 -3
- data/doc/_index.html +51 -24
- data/doc/class_list.html +1 -1
- data/doc/file.README.html +1 -1
- data/doc/index.html +1 -1
- data/doc/method_list.html +63 -69
- data/doc/top-level-namespace.html +2 -2
- data/lib/mbrao.rb +7 -2
- data/lib/mbrao/author.rb +5 -5
- data/lib/mbrao/content.rb +110 -256
- data/lib/mbrao/content_interface.rb +146 -0
- data/lib/mbrao/exceptions.rb +1 -1
- data/lib/mbrao/integrations/rails.rb +48 -42
- data/lib/mbrao/parser.rb +24 -176
- data/lib/mbrao/parser_interface.rb +143 -0
- data/lib/mbrao/parser_validations.rb +41 -0
- data/lib/mbrao/parsing_engines/base.rb +4 -4
- data/lib/mbrao/parsing_engines/plain_text.rb +136 -121
- data/lib/mbrao/rendering_engines/base.rb +2 -2
- data/lib/mbrao/rendering_engines/html_pipeline.rb +52 -77
- data/lib/mbrao/rendering_engines/html_pipeline/kramdown_filter.rb +31 -0
- data/lib/mbrao/version.rb +2 -2
- data/mbrao.gemspec +3 -3
- data/spec/mbrao/author_spec.rb +1 -1
- data/spec/mbrao/content_spec.rb +1 -1
- data/spec/mbrao/parser_spec.rb +16 -16
- data/spec/mbrao/rendering_engines/html_pipeline/kramdown_filter_spec.rb +28 -0
- data/spec/mbrao/rendering_engines/html_pipeline_spec.rb +0 -21
- metadata +23 -8
@@ -0,0 +1,817 @@
|
|
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 http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
6
|
+
<title>
|
7
|
+
Module: Mbrao::ContentInterface
|
8
|
+
|
9
|
+
— Documentation by YARD 0.8.7.4
|
10
|
+
|
11
|
+
</title>
|
12
|
+
|
13
|
+
<link rel="stylesheet" href="../css/style.css" type="text/css" charset="utf-8" />
|
14
|
+
|
15
|
+
<link rel="stylesheet" href="../css/common.css" type="text/css" charset="utf-8" />
|
16
|
+
|
17
|
+
<script type="text/javascript" charset="utf-8">
|
18
|
+
hasFrames = window.top.frames.main ? true : false;
|
19
|
+
relpath = '../';
|
20
|
+
framesUrl = "../frames.html#!Mbrao/ContentInterface.html";
|
21
|
+
</script>
|
22
|
+
|
23
|
+
|
24
|
+
<script type="text/javascript" charset="utf-8" src="../js/jquery.js"></script>
|
25
|
+
|
26
|
+
<script type="text/javascript" charset="utf-8" src="../js/app.js"></script>
|
27
|
+
|
28
|
+
|
29
|
+
</head>
|
30
|
+
<body>
|
31
|
+
<div id="header">
|
32
|
+
<div id="menu">
|
33
|
+
|
34
|
+
<a href="../_index.html">Index (C)</a> »
|
35
|
+
<span class='title'><span class='object_link'><a href="../Mbrao.html" title="Mbrao (module)">Mbrao</a></span></span>
|
36
|
+
»
|
37
|
+
<span class="title">ContentInterface</span>
|
38
|
+
|
39
|
+
|
40
|
+
<div class="noframes"><span class="title">(</span><a href="." target="_top">no frames</a><span class="title">)</span></div>
|
41
|
+
</div>
|
42
|
+
|
43
|
+
<div id="search">
|
44
|
+
|
45
|
+
<a class="full_list_link" id="class_list_link"
|
46
|
+
href="../class_list.html">
|
47
|
+
Class List
|
48
|
+
</a>
|
49
|
+
|
50
|
+
<a class="full_list_link" id="method_list_link"
|
51
|
+
href="../method_list.html">
|
52
|
+
Method List
|
53
|
+
</a>
|
54
|
+
|
55
|
+
<a class="full_list_link" id="file_list_link"
|
56
|
+
href="../file_list.html">
|
57
|
+
File List
|
58
|
+
</a>
|
59
|
+
|
60
|
+
</div>
|
61
|
+
<div class="clear"></div>
|
62
|
+
</div>
|
63
|
+
|
64
|
+
<iframe id="search_frame"></iframe>
|
65
|
+
|
66
|
+
<div id="content"><h1>Module: Mbrao::ContentInterface
|
67
|
+
|
68
|
+
|
69
|
+
|
70
|
+
</h1>
|
71
|
+
|
72
|
+
<dl class="box">
|
73
|
+
|
74
|
+
|
75
|
+
|
76
|
+
<dt class="r1">Extended by:</dt>
|
77
|
+
<dd class="r1">ActiveSupport::Concern</dd>
|
78
|
+
|
79
|
+
|
80
|
+
|
81
|
+
|
82
|
+
|
83
|
+
|
84
|
+
<dt class="r2">Included in:</dt>
|
85
|
+
<dd class="r2"><span class='object_link'><a href="Content.html" title="Mbrao::Content (class)">Content</a></span></dd>
|
86
|
+
|
87
|
+
|
88
|
+
|
89
|
+
<dt class="r1 last">Defined in:</dt>
|
90
|
+
<dd class="r1 last">lib/mbrao/content_interface.rb</dd>
|
91
|
+
|
92
|
+
</dl>
|
93
|
+
<div class="clear"></div>
|
94
|
+
|
95
|
+
<h2>Overview</h2><div class="docstring">
|
96
|
+
<div class="discussion">
|
97
|
+
<p>Miscellaneous <span class='object_link'><a href="Content.html" title="Mbrao::Content (class)">Content</a></span> class methods.</p>
|
98
|
+
|
99
|
+
|
100
|
+
</div>
|
101
|
+
</div>
|
102
|
+
<div class="tags">
|
103
|
+
|
104
|
+
|
105
|
+
</div><h2>Defined Under Namespace</h2>
|
106
|
+
<p class="children">
|
107
|
+
|
108
|
+
|
109
|
+
<strong class="modules">Modules:</strong> <span class='object_link'><a href="ContentInterface/ClassMethods.html" title="Mbrao::ContentInterface::ClassMethods (module)">ClassMethods</a></span>
|
110
|
+
|
111
|
+
|
112
|
+
|
113
|
+
|
114
|
+
</p>
|
115
|
+
|
116
|
+
<h2>Constant Summary</h2>
|
117
|
+
|
118
|
+
<dl class="constants">
|
119
|
+
|
120
|
+
<dt id="ALLOWED_DATETIME_FORMATS-constant" class="">ALLOWED_DATETIME_FORMATS =
|
121
|
+
<div class="docstring">
|
122
|
+
<div class="discussion">
|
123
|
+
<p>The allowed string format for a datetime.</p>
|
124
|
+
|
125
|
+
|
126
|
+
</div>
|
127
|
+
</div>
|
128
|
+
<div class="tags">
|
129
|
+
|
130
|
+
|
131
|
+
</div>
|
132
|
+
</dt>
|
133
|
+
<dd><pre class="code"><span class='lbracket'>[</span>
|
134
|
+
<span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>%Y%m%dT%H%M%S%z</span><span class='tstring_end'>"</span></span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>%Y%m%dT%H%M%S%Z</span><span class='tstring_end'>"</span></span><span class='comma'>,</span>
|
135
|
+
<span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>%FT%T.%L%z</span><span class='tstring_end'>"</span></span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>%FT%T.%L%Z</span><span class='tstring_end'>"</span></span><span class='comma'>,</span>
|
136
|
+
<span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>%FT%T%z</span><span class='tstring_end'>"</span></span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>%FT%T%Z</span><span class='tstring_end'>"</span></span><span class='comma'>,</span>
|
137
|
+
<span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>%F %T %z</span><span class='tstring_end'>"</span></span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>%F %T %Z</span><span class='tstring_end'>"</span></span><span class='comma'>,</span>
|
138
|
+
<span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>%F %T.%L %z</span><span class='tstring_end'>"</span></span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>%F %T.%L %Z</span><span class='tstring_end'>"</span></span><span class='comma'>,</span>
|
139
|
+
|
140
|
+
<span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>%F %T.%L</span><span class='tstring_end'>"</span></span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>%F %T</span><span class='tstring_end'>"</span></span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>%F %H:%M</span><span class='tstring_end'>"</span></span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>%F</span><span class='tstring_end'>"</span></span><span class='comma'>,</span>
|
141
|
+
<span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>%d/%m/%Y %T.%L</span><span class='tstring_end'>"</span></span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>%d/%m/%Y %T</span><span class='tstring_end'>"</span></span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>%d/%m/%Y %H:%M</span><span class='tstring_end'>"</span></span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>%d/%m/%Y</span><span class='tstring_end'>"</span></span>
|
142
|
+
<span class='rbracket'>]</span></pre></dd>
|
143
|
+
|
144
|
+
</dl>
|
145
|
+
|
146
|
+
|
147
|
+
|
148
|
+
|
149
|
+
|
150
|
+
|
151
|
+
|
152
|
+
|
153
|
+
|
154
|
+
<h2>
|
155
|
+
Instance Method Summary
|
156
|
+
<small>(<a href="#" class="summary_toggle">collapse</a>)</small>
|
157
|
+
</h2>
|
158
|
+
|
159
|
+
<ul class="summary">
|
160
|
+
|
161
|
+
<li class="public ">
|
162
|
+
<span class="summary_signature">
|
163
|
+
|
164
|
+
<a href="#as_json-instance_method" title="#as_json (instance method)">- (Hash) <strong>as_json</strong>(options = {}) </a>
|
165
|
+
|
166
|
+
|
167
|
+
|
168
|
+
</span>
|
169
|
+
|
170
|
+
|
171
|
+
|
172
|
+
|
173
|
+
|
174
|
+
|
175
|
+
|
176
|
+
|
177
|
+
|
178
|
+
<span class="summary_desc"><div class='inline'><p>Returns the content as an Hash.</p>
|
179
|
+
</div></span>
|
180
|
+
|
181
|
+
</li>
|
182
|
+
|
183
|
+
|
184
|
+
<li class="public ">
|
185
|
+
<span class="summary_signature">
|
186
|
+
|
187
|
+
<a href="#enabled_for_locales%3F-instance_method" title="#enabled_for_locales? (instance method)">- (Boolean) <strong>enabled_for_locales?</strong>(*locales) </a>
|
188
|
+
|
189
|
+
|
190
|
+
|
191
|
+
</span>
|
192
|
+
|
193
|
+
|
194
|
+
|
195
|
+
|
196
|
+
|
197
|
+
|
198
|
+
|
199
|
+
|
200
|
+
|
201
|
+
<span class="summary_desc"><div class='inline'><p>Checks if the content is available for at least one of the provided locales.</p>
|
202
|
+
</div></span>
|
203
|
+
|
204
|
+
</li>
|
205
|
+
|
206
|
+
|
207
|
+
<li class="public ">
|
208
|
+
<span class="summary_signature">
|
209
|
+
|
210
|
+
<a href="#get_body-instance_method" title="#get_body (instance method)">- (String|HashWithIndifferentAccess) <strong>get_body</strong>(locales = [], engine = :plain_text) </a>
|
211
|
+
|
212
|
+
|
213
|
+
|
214
|
+
</span>
|
215
|
+
|
216
|
+
|
217
|
+
|
218
|
+
|
219
|
+
|
220
|
+
|
221
|
+
|
222
|
+
|
223
|
+
|
224
|
+
<span class="summary_desc"><div class='inline'><p>Gets the body returning only the portion which are available for the given locales.</p>
|
225
|
+
</div></span>
|
226
|
+
|
227
|
+
</li>
|
228
|
+
|
229
|
+
|
230
|
+
<li class="public ">
|
231
|
+
<span class="summary_signature">
|
232
|
+
|
233
|
+
<a href="#get_more-instance_method" title="#get_more (instance method)">- (String|HashWithIndifferentAccess) <strong>get_more</strong>(locales = []) </a>
|
234
|
+
|
235
|
+
|
236
|
+
|
237
|
+
</span>
|
238
|
+
|
239
|
+
|
240
|
+
|
241
|
+
|
242
|
+
|
243
|
+
|
244
|
+
|
245
|
+
|
246
|
+
|
247
|
+
<span class="summary_desc"><div class='inline'><p>Gets the “more link” text of the content in the desired locales.</p>
|
248
|
+
</div></span>
|
249
|
+
|
250
|
+
</li>
|
251
|
+
|
252
|
+
|
253
|
+
<li class="public ">
|
254
|
+
<span class="summary_signature">
|
255
|
+
|
256
|
+
<a href="#get_tags-instance_method" title="#get_tags (instance method)">- (Array|HashWithIndifferentAccess) <strong>get_tags</strong>(locales = []) </a>
|
257
|
+
|
258
|
+
|
259
|
+
|
260
|
+
</span>
|
261
|
+
|
262
|
+
|
263
|
+
|
264
|
+
|
265
|
+
|
266
|
+
|
267
|
+
|
268
|
+
|
269
|
+
|
270
|
+
<span class="summary_desc"><div class='inline'><p>Gets the tags of the content in the desired locales.</p>
|
271
|
+
</div></span>
|
272
|
+
|
273
|
+
</li>
|
274
|
+
|
275
|
+
|
276
|
+
<li class="public ">
|
277
|
+
<span class="summary_signature">
|
278
|
+
|
279
|
+
<a href="#get_title-instance_method" title="#get_title (instance method)">- (String|HashWithIndifferentAccess) <strong>get_title</strong>(locales = []) </a>
|
280
|
+
|
281
|
+
|
282
|
+
|
283
|
+
</span>
|
284
|
+
|
285
|
+
|
286
|
+
|
287
|
+
|
288
|
+
|
289
|
+
|
290
|
+
|
291
|
+
|
292
|
+
|
293
|
+
<span class="summary_desc"><div class='inline'><p>Gets the title of the content in the desired locales.</p>
|
294
|
+
</div></span>
|
295
|
+
|
296
|
+
</li>
|
297
|
+
|
298
|
+
|
299
|
+
</ul>
|
300
|
+
|
301
|
+
|
302
|
+
|
303
|
+
|
304
|
+
|
305
|
+
<div id="instance_method_details" class="method_details_list">
|
306
|
+
<h2>Instance Method Details</h2>
|
307
|
+
|
308
|
+
|
309
|
+
<div class="method_details first">
|
310
|
+
<h3 class="signature first" id="as_json-instance_method">
|
311
|
+
|
312
|
+
- (<tt>Hash</tt>) <strong>as_json</strong>(options = {})
|
313
|
+
|
314
|
+
|
315
|
+
|
316
|
+
|
317
|
+
|
318
|
+
</h3><div class="docstring">
|
319
|
+
<div class="discussion">
|
320
|
+
<p>Returns the content as an Hash.</p>
|
321
|
+
|
322
|
+
|
323
|
+
</div>
|
324
|
+
</div>
|
325
|
+
<div class="tags">
|
326
|
+
<p class="tag_title">Parameters:</p>
|
327
|
+
<ul class="param">
|
328
|
+
|
329
|
+
<li>
|
330
|
+
|
331
|
+
<span class='name'>options</span>
|
332
|
+
|
333
|
+
|
334
|
+
<span class='type'>(<tt>Hash</tt>)</span>
|
335
|
+
|
336
|
+
|
337
|
+
<em class="default">(defaults to: <tt>{}</tt>)</em>
|
338
|
+
|
339
|
+
|
340
|
+
—
|
341
|
+
<div class='inline'><p>Options to modify behavior of the serialization.
|
342
|
+
The only supported value are:</p>
|
343
|
+
|
344
|
+
<ul>
|
345
|
+
<li><code>:exclude</code>, an array of attributes to skip.</li>
|
346
|
+
<li><code>:exclude_empty</code>, if to exclude nil values. Default is <code>false</code>.</li>
|
347
|
+
</ul>
|
348
|
+
</div>
|
349
|
+
|
350
|
+
</li>
|
351
|
+
|
352
|
+
</ul>
|
353
|
+
|
354
|
+
<p class="tag_title">Returns:</p>
|
355
|
+
<ul class="return">
|
356
|
+
|
357
|
+
<li>
|
358
|
+
|
359
|
+
|
360
|
+
<span class='type'>(<tt>Hash</tt>)</span>
|
361
|
+
|
362
|
+
|
363
|
+
|
364
|
+
—
|
365
|
+
<div class='inline'><p>An hash with all attributes.</p>
|
366
|
+
</div>
|
367
|
+
|
368
|
+
</li>
|
369
|
+
|
370
|
+
</ul>
|
371
|
+
|
372
|
+
</div><table class="source_code">
|
373
|
+
<tr>
|
374
|
+
<td>
|
375
|
+
<pre class="lines">
|
376
|
+
|
377
|
+
|
378
|
+
106
|
379
|
+
107
|
380
|
+
108
|
381
|
+
109</pre>
|
382
|
+
</td>
|
383
|
+
<td>
|
384
|
+
<pre class="code"><span class="info file"># File 'lib/mbrao/content_interface.rb', line 106</span>
|
385
|
+
|
386
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_as_json'>as_json</span><span class='lparen'>(</span><span class='id identifier rubyid_options'>options</span> <span class='op'>=</span> <span class='lbrace'>{</span><span class='rbrace'>}</span><span class='rparen'>)</span>
|
387
|
+
<span class='id identifier rubyid_keys'>keys</span> <span class='op'>=</span> <span class='lbracket'>[</span><span class='symbol'>:uid</span><span class='comma'>,</span> <span class='symbol'>:locales</span><span class='comma'>,</span> <span class='symbol'>:title</span><span class='comma'>,</span> <span class='symbol'>:summary</span><span class='comma'>,</span> <span class='symbol'>:body</span><span class='comma'>,</span> <span class='symbol'>:tags</span><span class='comma'>,</span> <span class='symbol'>:more</span><span class='comma'>,</span> <span class='symbol'>:author</span><span class='comma'>,</span> <span class='symbol'>:created_at</span><span class='comma'>,</span> <span class='symbol'>:updated_at</span><span class='comma'>,</span> <span class='symbol'>:metadata</span><span class='rbracket'>]</span>
|
388
|
+
<span class='op'>::</span><span class='const'>Mbrao</span><span class='op'>::</span><span class='const'>Parser</span><span class='period'>.</span><span class='id identifier rubyid_as_json'>as_json</span><span class='lparen'>(</span><span class='kw'>self</span><span class='comma'>,</span> <span class='id identifier rubyid_keys'>keys</span><span class='comma'>,</span> <span class='id identifier rubyid_options'>options</span><span class='rparen'>)</span>
|
389
|
+
<span class='kw'>end</span></pre>
|
390
|
+
</td>
|
391
|
+
</tr>
|
392
|
+
</table>
|
393
|
+
</div>
|
394
|
+
|
395
|
+
<div class="method_details ">
|
396
|
+
<h3 class="signature " id="enabled_for_locales?-instance_method">
|
397
|
+
|
398
|
+
- (<tt>Boolean</tt>) <strong>enabled_for_locales?</strong>(*locales)
|
399
|
+
|
400
|
+
|
401
|
+
|
402
|
+
|
403
|
+
|
404
|
+
</h3><div class="docstring">
|
405
|
+
<div class="discussion">
|
406
|
+
<p>Checks if the content is available for at least one of the provided locales.</p>
|
407
|
+
|
408
|
+
|
409
|
+
</div>
|
410
|
+
</div>
|
411
|
+
<div class="tags">
|
412
|
+
<p class="tag_title">Parameters:</p>
|
413
|
+
<ul class="param">
|
414
|
+
|
415
|
+
<li>
|
416
|
+
|
417
|
+
<span class='name'>locales</span>
|
418
|
+
|
419
|
+
|
420
|
+
<span class='type'>(<tt>Array</tt>)</span>
|
421
|
+
|
422
|
+
|
423
|
+
|
424
|
+
—
|
425
|
+
<div class='inline'><p>The desired locales. Can include <code>*</code> to match all. If none are specified, the default mbrao locale will be used.</p>
|
426
|
+
</div>
|
427
|
+
|
428
|
+
</li>
|
429
|
+
|
430
|
+
</ul>
|
431
|
+
|
432
|
+
<p class="tag_title">Returns:</p>
|
433
|
+
<ul class="return">
|
434
|
+
|
435
|
+
<li>
|
436
|
+
|
437
|
+
|
438
|
+
<span class='type'>(<tt>Boolean</tt>)</span>
|
439
|
+
|
440
|
+
|
441
|
+
|
442
|
+
—
|
443
|
+
<div class='inline'><p><code>true</code> if the content is available for at least one of the desired locales, <code>false</code> otherwise.</p>
|
444
|
+
</div>
|
445
|
+
|
446
|
+
</li>
|
447
|
+
|
448
|
+
</ul>
|
449
|
+
|
450
|
+
</div><table class="source_code">
|
451
|
+
<tr>
|
452
|
+
<td>
|
453
|
+
<pre class="lines">
|
454
|
+
|
455
|
+
|
456
|
+
56
|
457
|
+
57
|
458
|
+
58
|
459
|
+
59</pre>
|
460
|
+
</td>
|
461
|
+
<td>
|
462
|
+
<pre class="code"><span class="info file"># File 'lib/mbrao/content_interface.rb', line 56</span>
|
463
|
+
|
464
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_enabled_for_locales?'>enabled_for_locales?</span><span class='lparen'>(</span><span class='op'>*</span><span class='id identifier rubyid_locales'>locales</span><span class='rparen'>)</span>
|
465
|
+
<span class='id identifier rubyid_locales'>locales</span> <span class='op'>=</span> <span class='id identifier rubyid_locales'>locales</span><span class='period'>.</span><span class='id identifier rubyid_flatten'>flatten</span><span class='period'>.</span><span class='id identifier rubyid_ensure_array'>ensure_array</span><span class='lparen'>(</span><span class='kw'>nil</span><span class='comma'>,</span> <span class='kw'>false</span><span class='comma'>,</span> <span class='kw'>false</span><span class='comma'>,</span> <span class='kw'>true</span><span class='rparen'>)</span> <span class='lbrace'>{</span> <span class='op'>|</span><span class='id identifier rubyid_l'>l</span><span class='op'>|</span> <span class='id identifier rubyid_l'>l</span><span class='period'>.</span><span class='id identifier rubyid_ensure_string'>ensure_string</span><span class='period'>.</span><span class='id identifier rubyid_strip'>strip</span> <span class='rbrace'>}</span><span class='period'>.</span><span class='id identifier rubyid_reject'>reject</span> <span class='lbrace'>{</span> <span class='op'>|</span><span class='id identifier rubyid_l'>l</span><span class='op'>|</span> <span class='id identifier rubyid_l'>l</span> <span class='op'>==</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>*</span><span class='tstring_end'>"</span></span> <span class='rbrace'>}</span>
|
466
|
+
<span class='ivar'>@locales</span><span class='period'>.</span><span class='id identifier rubyid_blank?'>blank?</span> <span class='op'>||</span> <span class='id identifier rubyid_locales'>locales</span><span class='period'>.</span><span class='id identifier rubyid_blank?'>blank?</span> <span class='op'>||</span> <span class='lparen'>(</span><span class='ivar'>@locales</span> <span class='op'>&</span> <span class='id identifier rubyid_locales'>locales</span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_present?'>present?</span>
|
467
|
+
<span class='kw'>end</span></pre>
|
468
|
+
</td>
|
469
|
+
</tr>
|
470
|
+
</table>
|
471
|
+
</div>
|
472
|
+
|
473
|
+
<div class="method_details ">
|
474
|
+
<h3 class="signature " id="get_body-instance_method">
|
475
|
+
|
476
|
+
- (<tt>String|HashWithIndifferentAccess</tt>) <strong>get_body</strong>(locales = [], engine = :plain_text)
|
477
|
+
|
478
|
+
|
479
|
+
|
480
|
+
|
481
|
+
|
482
|
+
</h3><div class="docstring">
|
483
|
+
<div class="discussion">
|
484
|
+
<p>Gets the body returning only the portion which are available for the given locales.</p>
|
485
|
+
|
486
|
+
|
487
|
+
</div>
|
488
|
+
</div>
|
489
|
+
<div class="tags">
|
490
|
+
<p class="tag_title">Parameters:</p>
|
491
|
+
<ul class="param">
|
492
|
+
|
493
|
+
<li>
|
494
|
+
|
495
|
+
<span class='name'>locales</span>
|
496
|
+
|
497
|
+
|
498
|
+
<span class='type'>(<tt>String|Array</tt>)</span>
|
499
|
+
|
500
|
+
|
501
|
+
<em class="default">(defaults to: <tt>[]</tt>)</em>
|
502
|
+
|
503
|
+
|
504
|
+
—
|
505
|
+
<div class='inline'><p>The desired locales. Can include <code>*</code> to match all. If none are specified, the default mbrao locale will be used.</p>
|
506
|
+
</div>
|
507
|
+
|
508
|
+
</li>
|
509
|
+
|
510
|
+
<li>
|
511
|
+
|
512
|
+
<span class='name'>engine</span>
|
513
|
+
|
514
|
+
|
515
|
+
<span class='type'>(<tt>String|Symbol|Object</tt>)</span>
|
516
|
+
|
517
|
+
|
518
|
+
<em class="default">(defaults to: <tt>:plain_text</tt>)</em>
|
519
|
+
|
520
|
+
|
521
|
+
—
|
522
|
+
<div class='inline'><p>The engine to use to filter contents.</p>
|
523
|
+
</div>
|
524
|
+
|
525
|
+
</li>
|
526
|
+
|
527
|
+
</ul>
|
528
|
+
|
529
|
+
<p class="tag_title">Returns:</p>
|
530
|
+
<ul class="return">
|
531
|
+
|
532
|
+
<li>
|
533
|
+
|
534
|
+
|
535
|
+
<span class='type'>(<tt>String|HashWithIndifferentAccess</tt>)</span>
|
536
|
+
|
537
|
+
|
538
|
+
|
539
|
+
—
|
540
|
+
<div class='inline'><p>Return the body of the content in the desired locales. If only one locale is required, then a <code>String</code>
|
541
|
+
is returned, else a <code>HashWithIndifferentAccess</code> with locales as keys.</p>
|
542
|
+
</div>
|
543
|
+
|
544
|
+
</li>
|
545
|
+
|
546
|
+
</ul>
|
547
|
+
|
548
|
+
</div><table class="source_code">
|
549
|
+
<tr>
|
550
|
+
<td>
|
551
|
+
<pre class="lines">
|
552
|
+
|
553
|
+
|
554
|
+
76
|
555
|
+
77
|
556
|
+
78</pre>
|
557
|
+
</td>
|
558
|
+
<td>
|
559
|
+
<pre class="code"><span class="info file"># File 'lib/mbrao/content_interface.rb', line 76</span>
|
560
|
+
|
561
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_get_body'>get_body</span><span class='lparen'>(</span><span class='id identifier rubyid_locales'>locales</span> <span class='op'>=</span> <span class='lbracket'>[</span><span class='rbracket'>]</span><span class='comma'>,</span> <span class='id identifier rubyid_engine'>engine</span> <span class='op'>=</span> <span class='symbol'>:plain_text</span><span class='rparen'>)</span>
|
562
|
+
<span class='const'>Mbrao</span><span class='op'>::</span><span class='const'>Parser</span><span class='period'>.</span><span class='id identifier rubyid_create_engine'>create_engine</span><span class='lparen'>(</span><span class='id identifier rubyid_engine'>engine</span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_filter_content'>filter_content</span><span class='lparen'>(</span><span class='kw'>self</span><span class='comma'>,</span> <span class='id identifier rubyid_locales'>locales</span><span class='rparen'>)</span>
|
563
|
+
<span class='kw'>end</span></pre>
|
564
|
+
</td>
|
565
|
+
</tr>
|
566
|
+
</table>
|
567
|
+
</div>
|
568
|
+
|
569
|
+
<div class="method_details ">
|
570
|
+
<h3 class="signature " id="get_more-instance_method">
|
571
|
+
|
572
|
+
- (<tt>String|HashWithIndifferentAccess</tt>) <strong>get_more</strong>(locales = [])
|
573
|
+
|
574
|
+
|
575
|
+
|
576
|
+
|
577
|
+
|
578
|
+
</h3><div class="docstring">
|
579
|
+
<div class="discussion">
|
580
|
+
<p>Gets the “more link” text of the content in the desired locales.</p>
|
581
|
+
|
582
|
+
|
583
|
+
</div>
|
584
|
+
</div>
|
585
|
+
<div class="tags">
|
586
|
+
<p class="tag_title">Parameters:</p>
|
587
|
+
<ul class="param">
|
588
|
+
|
589
|
+
<li>
|
590
|
+
|
591
|
+
<span class='name'>locales</span>
|
592
|
+
|
593
|
+
|
594
|
+
<span class='type'>(<tt>String|Array</tt>)</span>
|
595
|
+
|
596
|
+
|
597
|
+
<em class="default">(defaults to: <tt>[]</tt>)</em>
|
598
|
+
|
599
|
+
|
600
|
+
—
|
601
|
+
<div class='inline'><p>The desired locales. Can include <code>*</code> to match all. If none are specified, the default mbrao locale will be used.</p>
|
602
|
+
</div>
|
603
|
+
|
604
|
+
</li>
|
605
|
+
|
606
|
+
</ul>
|
607
|
+
|
608
|
+
<p class="tag_title">Returns:</p>
|
609
|
+
<ul class="return">
|
610
|
+
|
611
|
+
<li>
|
612
|
+
|
613
|
+
|
614
|
+
<span class='type'>(<tt>String|HashWithIndifferentAccess</tt>)</span>
|
615
|
+
|
616
|
+
|
617
|
+
|
618
|
+
—
|
619
|
+
<div class='inline'><p>Return the label of the “more link” of the content in the desired locales. If only one locale is required,
|
620
|
+
then a <code>String</code> is returned, else a <code>HashWithIndifferentAccess</code> with locales as keys.</p>
|
621
|
+
</div>
|
622
|
+
|
623
|
+
</li>
|
624
|
+
|
625
|
+
</ul>
|
626
|
+
|
627
|
+
</div><table class="source_code">
|
628
|
+
<tr>
|
629
|
+
<td>
|
630
|
+
<pre class="lines">
|
631
|
+
|
632
|
+
|
633
|
+
94
|
634
|
+
95
|
635
|
+
96</pre>
|
636
|
+
</td>
|
637
|
+
<td>
|
638
|
+
<pre class="code"><span class="info file"># File 'lib/mbrao/content_interface.rb', line 94</span>
|
639
|
+
|
640
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_get_more'>get_more</span><span class='lparen'>(</span><span class='id identifier rubyid_locales'>locales</span> <span class='op'>=</span> <span class='lbracket'>[</span><span class='rbracket'>]</span><span class='rparen'>)</span>
|
641
|
+
<span class='id identifier rubyid_filter_attribute_for_locales'>filter_attribute_for_locales</span><span class='lparen'>(</span><span class='ivar'>@more</span><span class='comma'>,</span> <span class='id identifier rubyid_locales'>locales</span><span class='rparen'>)</span>
|
642
|
+
<span class='kw'>end</span></pre>
|
643
|
+
</td>
|
644
|
+
</tr>
|
645
|
+
</table>
|
646
|
+
</div>
|
647
|
+
|
648
|
+
<div class="method_details ">
|
649
|
+
<h3 class="signature " id="get_tags-instance_method">
|
650
|
+
|
651
|
+
- (<tt>Array|HashWithIndifferentAccess</tt>) <strong>get_tags</strong>(locales = [])
|
652
|
+
|
653
|
+
|
654
|
+
|
655
|
+
|
656
|
+
|
657
|
+
</h3><div class="docstring">
|
658
|
+
<div class="discussion">
|
659
|
+
<p>Gets the tags of the content in the desired locales.</p>
|
660
|
+
|
661
|
+
|
662
|
+
</div>
|
663
|
+
</div>
|
664
|
+
<div class="tags">
|
665
|
+
<p class="tag_title">Parameters:</p>
|
666
|
+
<ul class="param">
|
667
|
+
|
668
|
+
<li>
|
669
|
+
|
670
|
+
<span class='name'>locales</span>
|
671
|
+
|
672
|
+
|
673
|
+
<span class='type'>(<tt>String|Array</tt>)</span>
|
674
|
+
|
675
|
+
|
676
|
+
<em class="default">(defaults to: <tt>[]</tt>)</em>
|
677
|
+
|
678
|
+
|
679
|
+
—
|
680
|
+
<div class='inline'><p>The desired locales. Can include <code>*</code> to match all. If none are specified, the default mbrao locale will be used.</p>
|
681
|
+
</div>
|
682
|
+
|
683
|
+
</li>
|
684
|
+
|
685
|
+
</ul>
|
686
|
+
|
687
|
+
<p class="tag_title">Returns:</p>
|
688
|
+
<ul class="return">
|
689
|
+
|
690
|
+
<li>
|
691
|
+
|
692
|
+
|
693
|
+
<span class='type'>(<tt>Array|HashWithIndifferentAccess</tt>)</span>
|
694
|
+
|
695
|
+
|
696
|
+
|
697
|
+
—
|
698
|
+
<div class='inline'><p>Return the title of the content in the desired locales. If only one locale is required, then a <code>Array</code>
|
699
|
+
is returned, else a <code>HashWithIndifferentAccess</code> with locales as keys.</p>
|
700
|
+
</div>
|
701
|
+
|
702
|
+
</li>
|
703
|
+
|
704
|
+
</ul>
|
705
|
+
|
706
|
+
</div><table class="source_code">
|
707
|
+
<tr>
|
708
|
+
<td>
|
709
|
+
<pre class="lines">
|
710
|
+
|
711
|
+
|
712
|
+
85
|
713
|
+
86
|
714
|
+
87</pre>
|
715
|
+
</td>
|
716
|
+
<td>
|
717
|
+
<pre class="code"><span class="info file"># File 'lib/mbrao/content_interface.rb', line 85</span>
|
718
|
+
|
719
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_get_tags'>get_tags</span><span class='lparen'>(</span><span class='id identifier rubyid_locales'>locales</span> <span class='op'>=</span> <span class='lbracket'>[</span><span class='rbracket'>]</span><span class='rparen'>)</span>
|
720
|
+
<span class='id identifier rubyid_filter_attribute_for_locales'>filter_attribute_for_locales</span><span class='lparen'>(</span><span class='ivar'>@tags</span><span class='comma'>,</span> <span class='id identifier rubyid_locales'>locales</span><span class='rparen'>)</span>
|
721
|
+
<span class='kw'>end</span></pre>
|
722
|
+
</td>
|
723
|
+
</tr>
|
724
|
+
</table>
|
725
|
+
</div>
|
726
|
+
|
727
|
+
<div class="method_details ">
|
728
|
+
<h3 class="signature " id="get_title-instance_method">
|
729
|
+
|
730
|
+
- (<tt>String|HashWithIndifferentAccess</tt>) <strong>get_title</strong>(locales = [])
|
731
|
+
|
732
|
+
|
733
|
+
|
734
|
+
|
735
|
+
|
736
|
+
</h3><div class="docstring">
|
737
|
+
<div class="discussion">
|
738
|
+
<p>Gets the title of the content in the desired locales.</p>
|
739
|
+
|
740
|
+
|
741
|
+
</div>
|
742
|
+
</div>
|
743
|
+
<div class="tags">
|
744
|
+
<p class="tag_title">Parameters:</p>
|
745
|
+
<ul class="param">
|
746
|
+
|
747
|
+
<li>
|
748
|
+
|
749
|
+
<span class='name'>locales</span>
|
750
|
+
|
751
|
+
|
752
|
+
<span class='type'>(<tt>String|Array</tt>)</span>
|
753
|
+
|
754
|
+
|
755
|
+
<em class="default">(defaults to: <tt>[]</tt>)</em>
|
756
|
+
|
757
|
+
|
758
|
+
—
|
759
|
+
<div class='inline'><p>The desired locales. Can include <code>*</code> to match all. If none are specified, the default mbrao locale will be used.</p>
|
760
|
+
</div>
|
761
|
+
|
762
|
+
</li>
|
763
|
+
|
764
|
+
</ul>
|
765
|
+
|
766
|
+
<p class="tag_title">Returns:</p>
|
767
|
+
<ul class="return">
|
768
|
+
|
769
|
+
<li>
|
770
|
+
|
771
|
+
|
772
|
+
<span class='type'>(<tt>String|HashWithIndifferentAccess</tt>)</span>
|
773
|
+
|
774
|
+
|
775
|
+
|
776
|
+
—
|
777
|
+
<div class='inline'><p>Return the title of the content in the desired locales. If only one locale is required, then a <code>String</code>
|
778
|
+
is returned, else a <code>HashWithIndifferentAccess</code> with locales as keys.</p>
|
779
|
+
</div>
|
780
|
+
|
781
|
+
</li>
|
782
|
+
|
783
|
+
</ul>
|
784
|
+
|
785
|
+
</div><table class="source_code">
|
786
|
+
<tr>
|
787
|
+
<td>
|
788
|
+
<pre class="lines">
|
789
|
+
|
790
|
+
|
791
|
+
66
|
792
|
+
67
|
793
|
+
68</pre>
|
794
|
+
</td>
|
795
|
+
<td>
|
796
|
+
<pre class="code"><span class="info file"># File 'lib/mbrao/content_interface.rb', line 66</span>
|
797
|
+
|
798
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_get_title'>get_title</span><span class='lparen'>(</span><span class='id identifier rubyid_locales'>locales</span> <span class='op'>=</span> <span class='lbracket'>[</span><span class='rbracket'>]</span><span class='rparen'>)</span>
|
799
|
+
<span class='id identifier rubyid_filter_attribute_for_locales'>filter_attribute_for_locales</span><span class='lparen'>(</span><span class='ivar'>@title</span><span class='comma'>,</span> <span class='id identifier rubyid_locales'>locales</span><span class='rparen'>)</span>
|
800
|
+
<span class='kw'>end</span></pre>
|
801
|
+
</td>
|
802
|
+
</tr>
|
803
|
+
</table>
|
804
|
+
</div>
|
805
|
+
|
806
|
+
</div>
|
807
|
+
|
808
|
+
</div>
|
809
|
+
|
810
|
+
<div id="footer">
|
811
|
+
Generated on Sun May 11 18:17:17 2014 by
|
812
|
+
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
813
|
+
0.8.7.4 (ruby-2.1.0).
|
814
|
+
</div>
|
815
|
+
|
816
|
+
</body>
|
817
|
+
</html>
|