kharon 1.1.0 → 1.1.1
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 +5 -13
- data/{.rspec → .rspec.old} +0 -0
- data/Gemfile +1 -0
- data/Gemfile.lock +12 -4
- data/dist/kharon-1.1.0.gem +0 -0
- data/doc/Kharon.html +384 -6
- data/doc/Kharon/Errors.html +1 -1
- data/doc/Kharon/Errors/Validation.html +1 -1
- data/doc/Kharon/Handlers.html +1 -1
- data/doc/Kharon/Handlers/Exceptions.html +1 -1
- data/doc/Kharon/Handlers/Messages.html +1 -1
- data/doc/Kharon/Processor.html +425 -0
- data/doc/Kharon/Processors.html +144 -0
- data/doc/Kharon/Processors/ArrayProcessor.html +429 -0
- data/doc/Kharon/Processors/BooleanProcessor.html +306 -0
- data/doc/Kharon/Processors/BoxProcessor.html +440 -0
- data/doc/Kharon/Processors/DateProcessor.html +306 -0
- data/doc/Kharon/Processors/DatetimeProcessor.html +306 -0
- data/doc/Kharon/Processors/EmailProcessor.html +307 -0
- data/doc/Kharon/Processors/HashProcessor.html +431 -0
- data/doc/Kharon/Processors/IntegerProcessor.html +441 -0
- data/doc/Kharon/Processors/NumericProcessor.html +463 -0
- data/doc/Kharon/Processors/SSIDProcessor.html +307 -0
- data/doc/Kharon/Processors/TextProcessor.html +430 -0
- data/doc/Kharon/Validate.html +17 -5
- data/doc/Kharon/Validator.html +198 -1194
- data/doc/_index.html +159 -1
- data/doc/class_list.html +1 -1
- data/doc/file.README.html +15 -4
- data/doc/index.html +15 -4
- data/doc/method_list.html +135 -39
- data/doc/top-level-namespace.html +1 -1
- data/kharon.gemspec +4 -2
- data/lib/kharon.rb +32 -2
- data/lib/kharon/processor.rb +162 -0
- data/lib/kharon/processors.rb +6 -0
- data/lib/kharon/processors/array_processor.rb +30 -0
- data/lib/kharon/processors/boolean_processor.rb +31 -0
- data/lib/kharon/processors/box_processor.rb +63 -0
- data/lib/kharon/processors/date_processor.rb +21 -0
- data/lib/kharon/processors/datetime_processor.rb +21 -0
- data/lib/kharon/processors/email_processor.rb +21 -0
- data/lib/kharon/processors/hash_processor.rb +31 -0
- data/lib/kharon/processors/integer_processor.rb +55 -0
- data/lib/kharon/processors/numeric_processor.rb +66 -0
- data/lib/kharon/processors/ssid_processor.rb +21 -0
- data/lib/kharon/processors/text_processor.rb +30 -0
- data/lib/kharon/validate.rb +1 -1
- data/lib/kharon/validator.rb +26 -390
- data/lib/kharon/version.rb +1 -1
- data/spec/results.html +5277 -321
- metadata +69 -28
@@ -0,0 +1,441 @@
|
|
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
|
+
Class: Kharon::Processors::IntegerProcessor
|
8
|
+
|
9
|
+
— Documentation by YARD 0.8.7.6
|
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#!Kharon/Processors/IntegerProcessor.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 (I)</a> »
|
35
|
+
<span class='title'><span class='object_link'><a href="../../Kharon.html" title="Kharon (module)">Kharon</a></span></span> » <span class='title'><span class='object_link'><a href="../Processors.html" title="Kharon::Processors (module)">Processors</a></span></span>
|
36
|
+
»
|
37
|
+
<span class="title">IntegerProcessor</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>Class: Kharon::Processors::IntegerProcessor
|
67
|
+
|
68
|
+
|
69
|
+
|
70
|
+
</h1>
|
71
|
+
|
72
|
+
<dl class="box">
|
73
|
+
|
74
|
+
<dt class="r1">Inherits:</dt>
|
75
|
+
<dd class="r1">
|
76
|
+
<span class="inheritName"><span class='object_link'><a href="../Processor.html" title="Kharon::Processor (class)">Kharon::Processor</a></span></span>
|
77
|
+
|
78
|
+
<ul class="fullTree">
|
79
|
+
<li>Object</li>
|
80
|
+
|
81
|
+
<li class="next"><span class='object_link'><a href="../Processor.html" title="Kharon::Processor (class)">Kharon::Processor</a></span></li>
|
82
|
+
|
83
|
+
<li class="next">Kharon::Processors::IntegerProcessor</li>
|
84
|
+
|
85
|
+
</ul>
|
86
|
+
<a href="#" class="inheritanceTree">show all</a>
|
87
|
+
|
88
|
+
</dd>
|
89
|
+
|
90
|
+
|
91
|
+
|
92
|
+
|
93
|
+
|
94
|
+
|
95
|
+
|
96
|
+
|
97
|
+
|
98
|
+
<dt class="r2 last">Defined in:</dt>
|
99
|
+
<dd class="r2 last">lib/kharon/processors/integer_processor.rb</dd>
|
100
|
+
|
101
|
+
</dl>
|
102
|
+
<div class="clear"></div>
|
103
|
+
|
104
|
+
<h2>Overview</h2><div class="docstring">
|
105
|
+
<div class="discussion">
|
106
|
+
|
107
|
+
<p>Processor to validate integers. It has the :between, :min, and :max options
|
108
|
+
with the default ones.</p>
|
109
|
+
|
110
|
+
|
111
|
+
</div>
|
112
|
+
</div>
|
113
|
+
<div class="tags">
|
114
|
+
|
115
|
+
<p class="tag_title">Author:</p>
|
116
|
+
<ul class="author">
|
117
|
+
|
118
|
+
<li>
|
119
|
+
|
120
|
+
|
121
|
+
|
122
|
+
|
123
|
+
|
124
|
+
<div class='inline'>
|
125
|
+
<p>Vincent Courtois <courtois.vincent@outlook.com></p>
|
126
|
+
</div>
|
127
|
+
|
128
|
+
</li>
|
129
|
+
|
130
|
+
</ul>
|
131
|
+
|
132
|
+
</div>
|
133
|
+
|
134
|
+
|
135
|
+
|
136
|
+
|
137
|
+
|
138
|
+
<h2>Instance Attribute Summary</h2>
|
139
|
+
|
140
|
+
<h3 class="inherited">Attributes inherited from <span class='object_link'><a href="../Processor.html" title="Kharon::Processor (class)">Kharon::Processor</a></span></h3>
|
141
|
+
<p class="inherited"><span class='object_link'><a href="../Processor.html#validator-instance_method" title="Kharon::Processor#validator (method)">#validator</a></span></p>
|
142
|
+
|
143
|
+
|
144
|
+
|
145
|
+
<h2>
|
146
|
+
Instance Method Summary
|
147
|
+
<small>(<a href="#" class="summary_toggle">collapse</a>)</small>
|
148
|
+
</h2>
|
149
|
+
|
150
|
+
<ul class="summary">
|
151
|
+
|
152
|
+
<li class="public ">
|
153
|
+
<span class="summary_signature">
|
154
|
+
|
155
|
+
<a href="#process-instance_method" title="#process (instance method)">- (Object) <strong>process</strong>(key, options = {}) </a>
|
156
|
+
|
157
|
+
|
158
|
+
|
159
|
+
</span>
|
160
|
+
|
161
|
+
|
162
|
+
|
163
|
+
|
164
|
+
|
165
|
+
|
166
|
+
|
167
|
+
|
168
|
+
|
169
|
+
<span class="summary_desc"><div class='inline'>
|
170
|
+
<p>Checks if the given key is an integer or not.</p>
|
171
|
+
</div></span>
|
172
|
+
|
173
|
+
</li>
|
174
|
+
|
175
|
+
|
176
|
+
<li class="public ">
|
177
|
+
<span class="summary_signature">
|
178
|
+
|
179
|
+
<a href="#store-instance_method" title="#store (instance method)">- (Object) <strong>store</strong>(key, process, options = {}) </a>
|
180
|
+
|
181
|
+
|
182
|
+
|
183
|
+
</span>
|
184
|
+
|
185
|
+
|
186
|
+
|
187
|
+
|
188
|
+
|
189
|
+
|
190
|
+
|
191
|
+
|
192
|
+
|
193
|
+
<span class="summary_desc"><div class='inline'>
|
194
|
+
<p>Stores a numeric number after checking its limits if given.</p>
|
195
|
+
</div></span>
|
196
|
+
|
197
|
+
</li>
|
198
|
+
|
199
|
+
|
200
|
+
</ul>
|
201
|
+
|
202
|
+
|
203
|
+
|
204
|
+
|
205
|
+
|
206
|
+
|
207
|
+
|
208
|
+
|
209
|
+
|
210
|
+
|
211
|
+
|
212
|
+
<h3 class="inherited">Methods inherited from <span class='object_link'><a href="../Processor.html" title="Kharon::Processor (class)">Kharon::Processor</a></span></h3>
|
213
|
+
<p class="inherited"><span class='object_link'><a href="../Processor.html#initialize-instance_method" title="Kharon::Processor#initialize (method)">#initialize</a></span></p>
|
214
|
+
<div id="constructor_details" class="method_details_list">
|
215
|
+
<h2>Constructor Details</h2>
|
216
|
+
|
217
|
+
<p class="notice">This class inherits a constructor from <span class='object_link'><a href="../Processor.html#initialize-instance_method" title="Kharon::Processor#initialize (method)">Kharon::Processor</a></span></p>
|
218
|
+
|
219
|
+
</div>
|
220
|
+
|
221
|
+
|
222
|
+
<div id="instance_method_details" class="method_details_list">
|
223
|
+
<h2>Instance Method Details</h2>
|
224
|
+
|
225
|
+
|
226
|
+
<div class="method_details first">
|
227
|
+
<h3 class="signature first" id="process-instance_method">
|
228
|
+
|
229
|
+
- (<tt>Object</tt>) <strong>process</strong>(key, options = {})
|
230
|
+
|
231
|
+
|
232
|
+
|
233
|
+
|
234
|
+
|
235
|
+
</h3><div class="docstring">
|
236
|
+
<div class="discussion">
|
237
|
+
|
238
|
+
<p>Checks if the given key is an integer or not.</p>
|
239
|
+
|
240
|
+
|
241
|
+
</div>
|
242
|
+
</div>
|
243
|
+
<div class="tags">
|
244
|
+
|
245
|
+
<div class="examples">
|
246
|
+
<p class="tag_title">Examples:</p>
|
247
|
+
|
248
|
+
|
249
|
+
<p class="example_title"><div class='inline'>
|
250
|
+
<p>Validates a key so it has to be an integer superior or equal to 2.</p>
|
251
|
+
</div></p>
|
252
|
+
|
253
|
+
<pre class="example code"><code><span class='ivar'>@validator</span><span class='period'>.</span><span class='id identifier rubyid_integer'>integer</span><span class='lparen'>(</span><span class='symbol'>:an_integer_key</span><span class='comma'>,</span> <span class='label'>min:</span> <span class='int'>2</span><span class='rparen'>)</span></code></pre>
|
254
|
+
|
255
|
+
</div>
|
256
|
+
<p class="tag_title">Parameters:</p>
|
257
|
+
<ul class="param">
|
258
|
+
|
259
|
+
<li>
|
260
|
+
|
261
|
+
<span class='name'>key</span>
|
262
|
+
|
263
|
+
|
264
|
+
<span class='type'>(<tt>Object</tt>)</span>
|
265
|
+
|
266
|
+
|
267
|
+
|
268
|
+
—
|
269
|
+
<div class='inline'>
|
270
|
+
<p>the key about which verify the type.</p>
|
271
|
+
</div>
|
272
|
+
|
273
|
+
</li>
|
274
|
+
|
275
|
+
<li>
|
276
|
+
|
277
|
+
<span class='name'>options</span>
|
278
|
+
|
279
|
+
|
280
|
+
<span class='type'>(<tt>Hash</tt>)</span>
|
281
|
+
|
282
|
+
|
283
|
+
<em class="default">(defaults to: <tt>{}</tt>)</em>
|
284
|
+
|
285
|
+
|
286
|
+
—
|
287
|
+
<div class='inline'>
|
288
|
+
<p>a hash of options passed to this method (see documentation to know which
|
289
|
+
options pass).</p>
|
290
|
+
</div>
|
291
|
+
|
292
|
+
</li>
|
293
|
+
|
294
|
+
</ul>
|
295
|
+
|
296
|
+
|
297
|
+
</div><table class="source_code">
|
298
|
+
<tr>
|
299
|
+
<td>
|
300
|
+
<pre class="lines">
|
301
|
+
|
302
|
+
|
303
|
+
15
|
304
|
+
16
|
305
|
+
17
|
306
|
+
18</pre>
|
307
|
+
</td>
|
308
|
+
<td>
|
309
|
+
<pre class="code"><span class="info file"># File 'lib/kharon/processors/integer_processor.rb', line 15</span>
|
310
|
+
|
311
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_process'>process</span><span class='lparen'>(</span><span class='id identifier rubyid_key'>key</span><span class='comma'>,</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>
|
312
|
+
<span class='id identifier rubyid_before_all'>before_all</span><span class='lparen'>(</span><span class='id identifier rubyid_key'>key</span><span class='comma'>,</span> <span class='id identifier rubyid_options'>options</span><span class='rparen'>)</span>
|
313
|
+
<span class='id identifier rubyid_match?'>match?</span><span class='lparen'>(</span><span class='id identifier rubyid_key'>key</span><span class='comma'>,</span> <span class='tstring'><span class='regexp_beg'>/</span><span class='tstring_content'>\A\d+\Z</span><span class='regexp_end'>/</span></span><span class='rparen'>)</span> <span class='op'>?</span> <span class='id identifier rubyid_store'>store</span><span class='lparen'>(</span><span class='id identifier rubyid_key'>key</span><span class='comma'>,</span> <span class='tlambda'>-></span><span class='lparen'>(</span><span class='id identifier rubyid_item'>item</span><span class='rparen'>)</span><span class='tlambeg'>{</span><span class='id identifier rubyid_item'>item</span><span class='period'>.</span><span class='id identifier rubyid_to_i'>to_i</span><span class='rbrace'>}</span><span class='comma'>,</span> <span class='id identifier rubyid_options'>options</span><span class='rparen'>)</span> <span class='op'>:</span> <span class='id identifier rubyid_raise_type_error'>raise_type_error</span><span class='lparen'>(</span><span class='id identifier rubyid_key'>key</span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>Integer</span><span class='tstring_end'>"</span></span><span class='rparen'>)</span>
|
314
|
+
<span class='kw'>end</span></pre>
|
315
|
+
</td>
|
316
|
+
</tr>
|
317
|
+
</table>
|
318
|
+
</div>
|
319
|
+
|
320
|
+
<div class="method_details ">
|
321
|
+
<h3 class="signature " id="store-instance_method">
|
322
|
+
|
323
|
+
- (<tt>Object</tt>) <strong>store</strong>(key, process, options = {})
|
324
|
+
|
325
|
+
|
326
|
+
|
327
|
+
|
328
|
+
|
329
|
+
</h3><div class="docstring">
|
330
|
+
<div class="discussion">
|
331
|
+
|
332
|
+
<p>Stores a numeric number after checking its limits if given.</p>
|
333
|
+
|
334
|
+
|
335
|
+
</div>
|
336
|
+
</div>
|
337
|
+
<div class="tags">
|
338
|
+
<p class="tag_title">Parameters:</p>
|
339
|
+
<ul class="param">
|
340
|
+
|
341
|
+
<li>
|
342
|
+
|
343
|
+
<span class='name'>key</span>
|
344
|
+
|
345
|
+
|
346
|
+
<span class='type'>(<tt>Object</tt>)</span>
|
347
|
+
|
348
|
+
|
349
|
+
|
350
|
+
—
|
351
|
+
<div class='inline'>
|
352
|
+
<p>the key associated with the value to store in the filtered datas.</p>
|
353
|
+
</div>
|
354
|
+
|
355
|
+
</li>
|
356
|
+
|
357
|
+
<li>
|
358
|
+
|
359
|
+
<span class='name'>process</span>
|
360
|
+
|
361
|
+
|
362
|
+
<span class='type'>(<tt>Proc</tt>)</span>
|
363
|
+
|
364
|
+
|
365
|
+
|
366
|
+
—
|
367
|
+
<div class='inline'>
|
368
|
+
<p>a process (lambda) to execute on the initial value. Must contain strictly
|
369
|
+
one argument.</p>
|
370
|
+
</div>
|
371
|
+
|
372
|
+
</li>
|
373
|
+
|
374
|
+
<li>
|
375
|
+
|
376
|
+
<span class='name'>options</span>
|
377
|
+
|
378
|
+
|
379
|
+
<span class='type'>(<tt>Hash</tt>)</span>
|
380
|
+
|
381
|
+
|
382
|
+
<em class="default">(defaults to: <tt>{}</tt>)</em>
|
383
|
+
|
384
|
+
|
385
|
+
—
|
386
|
+
<div class='inline'>
|
387
|
+
<p>the options applied to the initial value.</p>
|
388
|
+
</div>
|
389
|
+
|
390
|
+
</li>
|
391
|
+
|
392
|
+
</ul>
|
393
|
+
|
394
|
+
|
395
|
+
</div><table class="source_code">
|
396
|
+
<tr>
|
397
|
+
<td>
|
398
|
+
<pre class="lines">
|
399
|
+
|
400
|
+
|
401
|
+
24
|
402
|
+
25
|
403
|
+
26
|
404
|
+
27
|
405
|
+
28
|
406
|
+
29
|
407
|
+
30
|
408
|
+
31
|
409
|
+
32
|
410
|
+
33</pre>
|
411
|
+
</td>
|
412
|
+
<td>
|
413
|
+
<pre class="code"><span class="info file"># File 'lib/kharon/processors/integer_processor.rb', line 24</span>
|
414
|
+
|
415
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_store'>store</span><span class='lparen'>(</span><span class='id identifier rubyid_key'>key</span><span class='comma'>,</span> <span class='id identifier rubyid_process'>process</span><span class='comma'>,</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>
|
416
|
+
<span class='kw'>if</span><span class='lparen'>(</span><span class='id identifier rubyid_options'>options</span><span class='period'>.</span><span class='id identifier rubyid_has_key?'>has_key?</span><span class='lparen'>(</span><span class='symbol'>:between</span><span class='rparen'>)</span><span class='rparen'>)</span>
|
417
|
+
<span class='id identifier rubyid_check_min_value'>check_min_value</span><span class='lparen'>(</span><span class='id identifier rubyid_key'>key</span><span class='comma'>,</span> <span class='id identifier rubyid_options'>options</span><span class='lbracket'>[</span><span class='symbol'>:between</span><span class='rbracket'>]</span><span class='lbracket'>[</span><span class='int'>0</span><span class='rbracket'>]</span><span class='rparen'>)</span>
|
418
|
+
<span class='id identifier rubyid_check_max_value'>check_max_value</span><span class='lparen'>(</span><span class='id identifier rubyid_key'>key</span><span class='comma'>,</span> <span class='id identifier rubyid_options'>options</span><span class='lbracket'>[</span><span class='symbol'>:between</span><span class='rbracket'>]</span><span class='lbracket'>[</span><span class='int'>1</span><span class='rbracket'>]</span><span class='rparen'>)</span>
|
419
|
+
<span class='kw'>else</span>
|
420
|
+
<span class='id identifier rubyid_check_min_value'>check_min_value</span><span class='lparen'>(</span><span class='id identifier rubyid_key'>key</span><span class='comma'>,</span> <span class='id identifier rubyid_options'>options</span><span class='lbracket'>[</span><span class='symbol'>:min</span><span class='rbracket'>]</span><span class='rparen'>)</span> <span class='kw'>if</span><span class='lparen'>(</span><span class='id identifier rubyid_options'>options</span><span class='period'>.</span><span class='id identifier rubyid_has_key?'>has_key?</span><span class='lparen'>(</span><span class='symbol'>:min</span><span class='rparen'>)</span><span class='rparen'>)</span>
|
421
|
+
<span class='id identifier rubyid_check_max_value'>check_max_value</span><span class='lparen'>(</span><span class='id identifier rubyid_key'>key</span><span class='comma'>,</span> <span class='id identifier rubyid_options'>options</span><span class='lbracket'>[</span><span class='symbol'>:max</span><span class='rbracket'>]</span><span class='rparen'>)</span> <span class='kw'>if</span><span class='lparen'>(</span><span class='id identifier rubyid_options'>options</span><span class='period'>.</span><span class='id identifier rubyid_has_key?'>has_key?</span><span class='lparen'>(</span><span class='symbol'>:max</span><span class='rparen'>)</span><span class='rparen'>)</span>
|
422
|
+
<span class='kw'>end</span>
|
423
|
+
<span class='kw'>super</span><span class='lparen'>(</span><span class='id identifier rubyid_key'>key</span><span class='comma'>,</span> <span class='id identifier rubyid_process'>process</span><span class='comma'>,</span> <span class='id identifier rubyid_options'>options</span><span class='rparen'>)</span>
|
424
|
+
<span class='kw'>end</span></pre>
|
425
|
+
</td>
|
426
|
+
</tr>
|
427
|
+
</table>
|
428
|
+
</div>
|
429
|
+
|
430
|
+
</div>
|
431
|
+
|
432
|
+
</div>
|
433
|
+
|
434
|
+
<div id="footer">
|
435
|
+
Generated on Thu Jun 2 16:20:55 2016 by
|
436
|
+
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
437
|
+
0.8.7.6 (ruby-1.9.3).
|
438
|
+
</div>
|
439
|
+
|
440
|
+
</body>
|
441
|
+
</html>
|
@@ -0,0 +1,463 @@
|
|
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
|
+
Class: Kharon::Processors::NumericProcessor
|
8
|
+
|
9
|
+
— Documentation by YARD 0.8.7.6
|
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#!Kharon/Processors/NumericProcessor.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 (N)</a> »
|
35
|
+
<span class='title'><span class='object_link'><a href="../../Kharon.html" title="Kharon (module)">Kharon</a></span></span> » <span class='title'><span class='object_link'><a href="../Processors.html" title="Kharon::Processors (module)">Processors</a></span></span>
|
36
|
+
»
|
37
|
+
<span class="title">NumericProcessor</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>Class: Kharon::Processors::NumericProcessor
|
67
|
+
|
68
|
+
|
69
|
+
|
70
|
+
</h1>
|
71
|
+
|
72
|
+
<dl class="box">
|
73
|
+
|
74
|
+
<dt class="r1">Inherits:</dt>
|
75
|
+
<dd class="r1">
|
76
|
+
<span class="inheritName"><span class='object_link'><a href="../Processor.html" title="Kharon::Processor (class)">Kharon::Processor</a></span></span>
|
77
|
+
|
78
|
+
<ul class="fullTree">
|
79
|
+
<li>Object</li>
|
80
|
+
|
81
|
+
<li class="next"><span class='object_link'><a href="../Processor.html" title="Kharon::Processor (class)">Kharon::Processor</a></span></li>
|
82
|
+
|
83
|
+
<li class="next">Kharon::Processors::NumericProcessor</li>
|
84
|
+
|
85
|
+
</ul>
|
86
|
+
<a href="#" class="inheritanceTree">show all</a>
|
87
|
+
|
88
|
+
</dd>
|
89
|
+
|
90
|
+
|
91
|
+
|
92
|
+
|
93
|
+
|
94
|
+
|
95
|
+
|
96
|
+
|
97
|
+
|
98
|
+
<dt class="r2 last">Defined in:</dt>
|
99
|
+
<dd class="r2 last">lib/kharon/processors/numeric_processor.rb</dd>
|
100
|
+
|
101
|
+
</dl>
|
102
|
+
<div class="clear"></div>
|
103
|
+
|
104
|
+
<h2>Overview</h2><div class="docstring">
|
105
|
+
<div class="discussion">
|
106
|
+
|
107
|
+
<p>Processor to validate integers. It has the :between, :round, :floor, :ceil,
|
108
|
+
:min, and :max options with the default ones.</p>
|
109
|
+
|
110
|
+
|
111
|
+
</div>
|
112
|
+
</div>
|
113
|
+
<div class="tags">
|
114
|
+
|
115
|
+
<p class="tag_title">Author:</p>
|
116
|
+
<ul class="author">
|
117
|
+
|
118
|
+
<li>
|
119
|
+
|
120
|
+
|
121
|
+
|
122
|
+
|
123
|
+
|
124
|
+
<div class='inline'>
|
125
|
+
<p>Vincent Courtois <courtois.vincent@outlook.com></p>
|
126
|
+
</div>
|
127
|
+
|
128
|
+
</li>
|
129
|
+
|
130
|
+
</ul>
|
131
|
+
|
132
|
+
</div>
|
133
|
+
|
134
|
+
|
135
|
+
|
136
|
+
|
137
|
+
|
138
|
+
<h2>Instance Attribute Summary</h2>
|
139
|
+
|
140
|
+
<h3 class="inherited">Attributes inherited from <span class='object_link'><a href="../Processor.html" title="Kharon::Processor (class)">Kharon::Processor</a></span></h3>
|
141
|
+
<p class="inherited"><span class='object_link'><a href="../Processor.html#validator-instance_method" title="Kharon::Processor#validator (method)">#validator</a></span></p>
|
142
|
+
|
143
|
+
|
144
|
+
|
145
|
+
<h2>
|
146
|
+
Instance Method Summary
|
147
|
+
<small>(<a href="#" class="summary_toggle">collapse</a>)</small>
|
148
|
+
</h2>
|
149
|
+
|
150
|
+
<ul class="summary">
|
151
|
+
|
152
|
+
<li class="public ">
|
153
|
+
<span class="summary_signature">
|
154
|
+
|
155
|
+
<a href="#process-instance_method" title="#process (instance method)">- (Object) <strong>process</strong>(key, options = {}) </a>
|
156
|
+
|
157
|
+
|
158
|
+
|
159
|
+
</span>
|
160
|
+
|
161
|
+
|
162
|
+
|
163
|
+
|
164
|
+
|
165
|
+
|
166
|
+
|
167
|
+
|
168
|
+
|
169
|
+
<span class="summary_desc"><div class='inline'>
|
170
|
+
<p>Checks if the given key is an integer or not.</p>
|
171
|
+
</div></span>
|
172
|
+
|
173
|
+
</li>
|
174
|
+
|
175
|
+
|
176
|
+
<li class="public ">
|
177
|
+
<span class="summary_signature">
|
178
|
+
|
179
|
+
<a href="#store-instance_method" title="#store (instance method)">- (Object) <strong>store</strong>(key, process, options) </a>
|
180
|
+
|
181
|
+
|
182
|
+
|
183
|
+
</span>
|
184
|
+
|
185
|
+
|
186
|
+
|
187
|
+
|
188
|
+
|
189
|
+
|
190
|
+
|
191
|
+
|
192
|
+
|
193
|
+
<span class="summary_desc"><div class='inline'>
|
194
|
+
<p>Stores a decimal number, then apply the eventually passed round, ceil, or
|
195
|
+
floor options.</p>
|
196
|
+
</div></span>
|
197
|
+
|
198
|
+
</li>
|
199
|
+
|
200
|
+
|
201
|
+
</ul>
|
202
|
+
|
203
|
+
|
204
|
+
|
205
|
+
|
206
|
+
|
207
|
+
|
208
|
+
|
209
|
+
|
210
|
+
|
211
|
+
|
212
|
+
|
213
|
+
<h3 class="inherited">Methods inherited from <span class='object_link'><a href="../Processor.html" title="Kharon::Processor (class)">Kharon::Processor</a></span></h3>
|
214
|
+
<p class="inherited"><span class='object_link'><a href="../Processor.html#initialize-instance_method" title="Kharon::Processor#initialize (method)">#initialize</a></span></p>
|
215
|
+
<div id="constructor_details" class="method_details_list">
|
216
|
+
<h2>Constructor Details</h2>
|
217
|
+
|
218
|
+
<p class="notice">This class inherits a constructor from <span class='object_link'><a href="../Processor.html#initialize-instance_method" title="Kharon::Processor#initialize (method)">Kharon::Processor</a></span></p>
|
219
|
+
|
220
|
+
</div>
|
221
|
+
|
222
|
+
|
223
|
+
<div id="instance_method_details" class="method_details_list">
|
224
|
+
<h2>Instance Method Details</h2>
|
225
|
+
|
226
|
+
|
227
|
+
<div class="method_details first">
|
228
|
+
<h3 class="signature first" id="process-instance_method">
|
229
|
+
|
230
|
+
- (<tt>Object</tt>) <strong>process</strong>(key, options = {})
|
231
|
+
|
232
|
+
|
233
|
+
|
234
|
+
|
235
|
+
|
236
|
+
</h3><div class="docstring">
|
237
|
+
<div class="discussion">
|
238
|
+
|
239
|
+
<p>Checks if the given key is an integer or not.</p>
|
240
|
+
|
241
|
+
|
242
|
+
</div>
|
243
|
+
</div>
|
244
|
+
<div class="tags">
|
245
|
+
|
246
|
+
<div class="examples">
|
247
|
+
<p class="tag_title">Examples:</p>
|
248
|
+
|
249
|
+
|
250
|
+
<p class="example_title"><div class='inline'>
|
251
|
+
<p>Validates a key so it has to be an integer superior or equal to 2.</p>
|
252
|
+
</div></p>
|
253
|
+
|
254
|
+
<pre class="example code"><code><span class='ivar'>@validator</span><span class='period'>.</span><span class='id identifier rubyid_integer'>integer</span><span class='lparen'>(</span><span class='symbol'>:an_integer_key</span><span class='comma'>,</span> <span class='label'>min:</span> <span class='int'>2</span><span class='rparen'>)</span></code></pre>
|
255
|
+
|
256
|
+
</div>
|
257
|
+
<p class="tag_title">Parameters:</p>
|
258
|
+
<ul class="param">
|
259
|
+
|
260
|
+
<li>
|
261
|
+
|
262
|
+
<span class='name'>key</span>
|
263
|
+
|
264
|
+
|
265
|
+
<span class='type'>(<tt>Object</tt>)</span>
|
266
|
+
|
267
|
+
|
268
|
+
|
269
|
+
—
|
270
|
+
<div class='inline'>
|
271
|
+
<p>the key about which verify the type.</p>
|
272
|
+
</div>
|
273
|
+
|
274
|
+
</li>
|
275
|
+
|
276
|
+
<li>
|
277
|
+
|
278
|
+
<span class='name'>options</span>
|
279
|
+
|
280
|
+
|
281
|
+
<span class='type'>(<tt>Hash</tt>)</span>
|
282
|
+
|
283
|
+
|
284
|
+
<em class="default">(defaults to: <tt>{}</tt>)</em>
|
285
|
+
|
286
|
+
|
287
|
+
—
|
288
|
+
<div class='inline'>
|
289
|
+
<p>a hash of options passed to this method (see documentation to know which
|
290
|
+
options pass).</p>
|
291
|
+
</div>
|
292
|
+
|
293
|
+
</li>
|
294
|
+
|
295
|
+
</ul>
|
296
|
+
|
297
|
+
|
298
|
+
</div><table class="source_code">
|
299
|
+
<tr>
|
300
|
+
<td>
|
301
|
+
<pre class="lines">
|
302
|
+
|
303
|
+
|
304
|
+
15
|
305
|
+
16
|
306
|
+
17
|
307
|
+
18</pre>
|
308
|
+
</td>
|
309
|
+
<td>
|
310
|
+
<pre class="code"><span class="info file"># File 'lib/kharon/processors/numeric_processor.rb', line 15</span>
|
311
|
+
|
312
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_process'>process</span><span class='lparen'>(</span><span class='id identifier rubyid_key'>key</span><span class='comma'>,</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>
|
313
|
+
<span class='id identifier rubyid_before_all'>before_all</span><span class='lparen'>(</span><span class='id identifier rubyid_key'>key</span><span class='comma'>,</span> <span class='id identifier rubyid_options'>options</span><span class='rparen'>)</span>
|
314
|
+
<span class='id identifier rubyid_match?'>match?</span><span class='lparen'>(</span><span class='id identifier rubyid_key'>key</span><span class='comma'>,</span> <span class='tstring'><span class='regexp_beg'>/</span><span class='tstring_content'>\A([+-]?\d+)([,.](\d+))?\Z</span><span class='regexp_end'>/</span></span><span class='rparen'>)</span> <span class='op'>?</span> <span class='id identifier rubyid_store'>store</span><span class='lparen'>(</span><span class='id identifier rubyid_key'>key</span><span class='comma'>,</span> <span class='tlambda'>-></span><span class='lparen'>(</span><span class='id identifier rubyid_item'>item</span><span class='rparen'>)</span><span class='tlambeg'>{</span><span class='id identifier rubyid_item'>item</span><span class='period'>.</span><span class='id identifier rubyid_to_s'>to_s</span><span class='period'>.</span><span class='id identifier rubyid_sub'>sub</span><span class='lparen'>(</span><span class='tstring'><span class='regexp_beg'>/</span><span class='tstring_content'>,</span><span class='regexp_end'>/</span></span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>.</span><span class='tstring_end'>"</span></span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_to_f'>to_f</span><span class='rbrace'>}</span><span class='comma'>,</span> <span class='id identifier rubyid_options'>options</span><span class='rparen'>)</span> <span class='op'>:</span> <span class='id identifier rubyid_raise_type_error'>raise_type_error</span><span class='lparen'>(</span><span class='id identifier rubyid_key'>key</span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>Numeric</span><span class='tstring_end'>"</span></span><span class='rparen'>)</span>
|
315
|
+
<span class='kw'>end</span></pre>
|
316
|
+
</td>
|
317
|
+
</tr>
|
318
|
+
</table>
|
319
|
+
</div>
|
320
|
+
|
321
|
+
<div class="method_details ">
|
322
|
+
<h3 class="signature " id="store-instance_method">
|
323
|
+
|
324
|
+
- (<tt>Object</tt>) <strong>store</strong>(key, process, options)
|
325
|
+
|
326
|
+
|
327
|
+
|
328
|
+
|
329
|
+
|
330
|
+
</h3><div class="docstring">
|
331
|
+
<div class="discussion">
|
332
|
+
|
333
|
+
<p>Stores a decimal number, then apply the eventually passed round, ceil, or
|
334
|
+
floor options.</p>
|
335
|
+
|
336
|
+
|
337
|
+
</div>
|
338
|
+
</div>
|
339
|
+
<div class="tags">
|
340
|
+
<p class="tag_title">Parameters:</p>
|
341
|
+
<ul class="param">
|
342
|
+
|
343
|
+
<li>
|
344
|
+
|
345
|
+
<span class='name'>key</span>
|
346
|
+
|
347
|
+
|
348
|
+
<span class='type'>(<tt>Object</tt>)</span>
|
349
|
+
|
350
|
+
|
351
|
+
|
352
|
+
—
|
353
|
+
<div class='inline'>
|
354
|
+
<p>the key associated with the value to store in the filtered datas.</p>
|
355
|
+
</div>
|
356
|
+
|
357
|
+
</li>
|
358
|
+
|
359
|
+
<li>
|
360
|
+
|
361
|
+
<span class='name'>process</span>
|
362
|
+
|
363
|
+
|
364
|
+
<span class='type'>(<tt>Proc</tt>)</span>
|
365
|
+
|
366
|
+
|
367
|
+
|
368
|
+
—
|
369
|
+
<div class='inline'>
|
370
|
+
<p>a process (lambda) to execute on the initial value. Must contain strictly
|
371
|
+
one argument.</p>
|
372
|
+
</div>
|
373
|
+
|
374
|
+
</li>
|
375
|
+
|
376
|
+
<li>
|
377
|
+
|
378
|
+
<span class='name'>options</span>
|
379
|
+
|
380
|
+
|
381
|
+
<span class='type'>(<tt>Hash</tt>)</span>
|
382
|
+
|
383
|
+
|
384
|
+
|
385
|
+
—
|
386
|
+
<div class='inline'>
|
387
|
+
<p>the options applied to the initial value.</p>
|
388
|
+
</div>
|
389
|
+
|
390
|
+
</li>
|
391
|
+
|
392
|
+
</ul>
|
393
|
+
|
394
|
+
|
395
|
+
</div><table class="source_code">
|
396
|
+
<tr>
|
397
|
+
<td>
|
398
|
+
<pre class="lines">
|
399
|
+
|
400
|
+
|
401
|
+
24
|
402
|
+
25
|
403
|
+
26
|
404
|
+
27
|
405
|
+
28
|
406
|
+
29
|
407
|
+
30
|
408
|
+
31
|
409
|
+
32
|
410
|
+
33
|
411
|
+
34
|
412
|
+
35
|
413
|
+
36
|
414
|
+
37
|
415
|
+
38
|
416
|
+
39
|
417
|
+
40
|
418
|
+
41
|
419
|
+
42
|
420
|
+
43
|
421
|
+
44</pre>
|
422
|
+
</td>
|
423
|
+
<td>
|
424
|
+
<pre class="code"><span class="info file"># File 'lib/kharon/processors/numeric_processor.rb', line 24</span>
|
425
|
+
|
426
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_store'>store</span><span class='lparen'>(</span><span class='id identifier rubyid_key'>key</span><span class='comma'>,</span> <span class='id identifier rubyid_process'>process</span><span class='comma'>,</span> <span class='id identifier rubyid_options'>options</span><span class='rparen'>)</span>
|
427
|
+
<span class='kw'>if</span><span class='lparen'>(</span><span class='id identifier rubyid_options'>options</span><span class='period'>.</span><span class='id identifier rubyid_has_key?'>has_key?</span><span class='lparen'>(</span><span class='symbol'>:between</span><span class='rparen'>)</span><span class='rparen'>)</span>
|
428
|
+
<span class='id identifier rubyid_check_min_value'>check_min_value</span><span class='lparen'>(</span><span class='id identifier rubyid_key'>key</span><span class='comma'>,</span> <span class='id identifier rubyid_options'>options</span><span class='lbracket'>[</span><span class='symbol'>:between</span><span class='rbracket'>]</span><span class='lbracket'>[</span><span class='int'>0</span><span class='rbracket'>]</span><span class='rparen'>)</span>
|
429
|
+
<span class='id identifier rubyid_check_max_value'>check_max_value</span><span class='lparen'>(</span><span class='id identifier rubyid_key'>key</span><span class='comma'>,</span> <span class='id identifier rubyid_options'>options</span><span class='lbracket'>[</span><span class='symbol'>:between</span><span class='rbracket'>]</span><span class='lbracket'>[</span><span class='int'>1</span><span class='rbracket'>]</span><span class='rparen'>)</span>
|
430
|
+
<span class='kw'>else</span>
|
431
|
+
<span class='id identifier rubyid_check_min_value'>check_min_value</span><span class='lparen'>(</span><span class='id identifier rubyid_key'>key</span><span class='comma'>,</span> <span class='id identifier rubyid_options'>options</span><span class='lbracket'>[</span><span class='symbol'>:min</span><span class='rbracket'>]</span><span class='rparen'>)</span> <span class='kw'>if</span><span class='lparen'>(</span><span class='id identifier rubyid_options'>options</span><span class='period'>.</span><span class='id identifier rubyid_has_key?'>has_key?</span><span class='lparen'>(</span><span class='symbol'>:min</span><span class='rparen'>)</span><span class='rparen'>)</span>
|
432
|
+
<span class='id identifier rubyid_check_max_value'>check_max_value</span><span class='lparen'>(</span><span class='id identifier rubyid_key'>key</span><span class='comma'>,</span> <span class='id identifier rubyid_options'>options</span><span class='lbracket'>[</span><span class='symbol'>:max</span><span class='rbracket'>]</span><span class='rparen'>)</span> <span class='kw'>if</span><span class='lparen'>(</span><span class='id identifier rubyid_options'>options</span><span class='period'>.</span><span class='id identifier rubyid_has_key?'>has_key?</span><span class='lparen'>(</span><span class='symbol'>:max</span><span class='rparen'>)</span><span class='rparen'>)</span>
|
433
|
+
<span class='kw'>end</span>
|
434
|
+
<span class='kw'>super</span><span class='lparen'>(</span><span class='id identifier rubyid_key'>key</span><span class='comma'>,</span> <span class='id identifier rubyid_process'>process</span><span class='comma'>,</span> <span class='id identifier rubyid_options'>options</span><span class='rparen'>)</span>
|
435
|
+
<span class='kw'>if</span> <span class='id identifier rubyid_options'>options</span><span class='period'>.</span><span class='id identifier rubyid_has_key?'>has_key?</span><span class='lparen'>(</span><span class='symbol'>:round</span><span class='rparen'>)</span>
|
436
|
+
<span class='kw'>if</span> <span class='id identifier rubyid_options'>options</span><span class='lbracket'>[</span><span class='symbol'>:round</span><span class='rbracket'>]</span><span class='period'>.</span><span class='id identifier rubyid_kind_of?'>kind_of?</span><span class='lparen'>(</span><span class='const'>Integer</span><span class='rparen'>)</span>
|
437
|
+
<span class='id identifier rubyid_validator'>validator</span><span class='period'>.</span><span class='id identifier rubyid_filtered'>filtered</span><span class='lbracket'>[</span><span class='id identifier rubyid_key'>key</span><span class='rbracket'>]</span> <span class='op'>=</span> <span class='id identifier rubyid_validator'>validator</span><span class='period'>.</span><span class='id identifier rubyid_filtered'>filtered</span><span class='lbracket'>[</span><span class='id identifier rubyid_key'>key</span><span class='rbracket'>]</span><span class='period'>.</span><span class='id identifier rubyid_round'>round</span><span class='lparen'>(</span><span class='id identifier rubyid_options'>options</span><span class='lbracket'>[</span><span class='symbol'>:round</span><span class='rbracket'>]</span><span class='rparen'>)</span> <span class='kw'>if</span> <span class='id identifier rubyid_validator'>validator</span><span class='period'>.</span><span class='id identifier rubyid_filtered'>filtered</span><span class='period'>.</span><span class='id identifier rubyid_has_key?'>has_key?</span><span class='lparen'>(</span><span class='id identifier rubyid_key'>key</span><span class='rparen'>)</span>
|
438
|
+
<span class='kw'>elsif</span> <span class='id identifier rubyid_options'>options</span><span class='lbracket'>[</span><span class='symbol'>:round</span><span class='rbracket'>]</span> <span class='op'>==</span> <span class='kw'>true</span>
|
439
|
+
<span class='id identifier rubyid_validator'>validator</span><span class='period'>.</span><span class='id identifier rubyid_filtered'>filtered</span><span class='lbracket'>[</span><span class='id identifier rubyid_key'>key</span><span class='rbracket'>]</span> <span class='op'>=</span> <span class='id identifier rubyid_validator'>validator</span><span class='period'>.</span><span class='id identifier rubyid_filtered'>filtered</span><span class='lbracket'>[</span><span class='id identifier rubyid_key'>key</span><span class='rbracket'>]</span><span class='period'>.</span><span class='id identifier rubyid_round'>round</span> <span class='kw'>if</span> <span class='id identifier rubyid_validator'>validator</span><span class='period'>.</span><span class='id identifier rubyid_filtered'>filtered</span><span class='period'>.</span><span class='id identifier rubyid_has_key?'>has_key?</span><span class='lparen'>(</span><span class='id identifier rubyid_key'>key</span><span class='rparen'>)</span>
|
440
|
+
<span class='kw'>end</span>
|
441
|
+
<span class='kw'>elsif</span><span class='lparen'>(</span><span class='id identifier rubyid_options'>options</span><span class='period'>.</span><span class='id identifier rubyid_has_key?'>has_key?</span><span class='lparen'>(</span><span class='symbol'>:floor</span><span class='rparen'>)</span> <span class='kw'>and</span> <span class='id identifier rubyid_options'>options</span><span class='lbracket'>[</span><span class='symbol'>:floor</span><span class='rbracket'>]</span> <span class='op'>==</span> <span class='kw'>true</span><span class='rparen'>)</span>
|
442
|
+
<span class='id identifier rubyid_validator'>validator</span><span class='period'>.</span><span class='id identifier rubyid_filtered'>filtered</span><span class='lbracket'>[</span><span class='id identifier rubyid_key'>key</span><span class='rbracket'>]</span> <span class='op'>=</span> <span class='id identifier rubyid_validator'>validator</span><span class='period'>.</span><span class='id identifier rubyid_filtered'>filtered</span><span class='lbracket'>[</span><span class='id identifier rubyid_key'>key</span><span class='rbracket'>]</span><span class='period'>.</span><span class='id identifier rubyid_floor'>floor</span> <span class='kw'>if</span> <span class='id identifier rubyid_validator'>validator</span><span class='period'>.</span><span class='id identifier rubyid_filtered'>filtered</span><span class='period'>.</span><span class='id identifier rubyid_has_key?'>has_key?</span><span class='lparen'>(</span><span class='id identifier rubyid_key'>key</span><span class='rparen'>)</span>
|
443
|
+
<span class='kw'>elsif</span><span class='lparen'>(</span><span class='id identifier rubyid_options'>options</span><span class='period'>.</span><span class='id identifier rubyid_has_key?'>has_key?</span><span class='lparen'>(</span><span class='symbol'>:ceil</span><span class='rparen'>)</span> <span class='kw'>and</span> <span class='id identifier rubyid_options'>options</span><span class='lbracket'>[</span><span class='symbol'>:ceil</span><span class='rbracket'>]</span> <span class='op'>==</span> <span class='kw'>true</span><span class='rparen'>)</span>
|
444
|
+
<span class='id identifier rubyid_validator'>validator</span><span class='period'>.</span><span class='id identifier rubyid_filtered'>filtered</span><span class='lbracket'>[</span><span class='id identifier rubyid_key'>key</span><span class='rbracket'>]</span> <span class='op'>=</span> <span class='id identifier rubyid_validator'>validator</span><span class='period'>.</span><span class='id identifier rubyid_filtered'>filtered</span><span class='lbracket'>[</span><span class='id identifier rubyid_key'>key</span><span class='rbracket'>]</span><span class='period'>.</span><span class='id identifier rubyid_ceil'>ceil</span> <span class='kw'>if</span> <span class='id identifier rubyid_validator'>validator</span><span class='period'>.</span><span class='id identifier rubyid_filtered'>filtered</span><span class='period'>.</span><span class='id identifier rubyid_has_key?'>has_key?</span><span class='lparen'>(</span><span class='id identifier rubyid_key'>key</span><span class='rparen'>)</span>
|
445
|
+
<span class='kw'>end</span>
|
446
|
+
<span class='kw'>end</span></pre>
|
447
|
+
</td>
|
448
|
+
</tr>
|
449
|
+
</table>
|
450
|
+
</div>
|
451
|
+
|
452
|
+
</div>
|
453
|
+
|
454
|
+
</div>
|
455
|
+
|
456
|
+
<div id="footer">
|
457
|
+
Generated on Thu Jun 2 16:20:55 2016 by
|
458
|
+
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
459
|
+
0.8.7.6 (ruby-1.9.3).
|
460
|
+
</div>
|
461
|
+
|
462
|
+
</body>
|
463
|
+
</html>
|