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,306 @@
|
|
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::DateProcessor
|
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/DateProcessor.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 (D)</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">DateProcessor</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::DateProcessor
|
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::DateProcessor</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/date_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 dates. It only has the default options.</p>
|
108
|
+
|
109
|
+
|
110
|
+
</div>
|
111
|
+
</div>
|
112
|
+
<div class="tags">
|
113
|
+
|
114
|
+
<p class="tag_title">Author:</p>
|
115
|
+
<ul class="author">
|
116
|
+
|
117
|
+
<li>
|
118
|
+
|
119
|
+
|
120
|
+
|
121
|
+
|
122
|
+
|
123
|
+
<div class='inline'>
|
124
|
+
<p>Vincent Courtois <courtois.vincent@outlook.com></p>
|
125
|
+
</div>
|
126
|
+
|
127
|
+
</li>
|
128
|
+
|
129
|
+
</ul>
|
130
|
+
|
131
|
+
</div>
|
132
|
+
|
133
|
+
|
134
|
+
|
135
|
+
|
136
|
+
|
137
|
+
<h2>Instance Attribute Summary</h2>
|
138
|
+
|
139
|
+
<h3 class="inherited">Attributes inherited from <span class='object_link'><a href="../Processor.html" title="Kharon::Processor (class)">Kharon::Processor</a></span></h3>
|
140
|
+
<p class="inherited"><span class='object_link'><a href="../Processor.html#validator-instance_method" title="Kharon::Processor#validator (method)">#validator</a></span></p>
|
141
|
+
|
142
|
+
|
143
|
+
|
144
|
+
<h2>
|
145
|
+
Instance Method Summary
|
146
|
+
<small>(<a href="#" class="summary_toggle">collapse</a>)</small>
|
147
|
+
</h2>
|
148
|
+
|
149
|
+
<ul class="summary">
|
150
|
+
|
151
|
+
<li class="public ">
|
152
|
+
<span class="summary_signature">
|
153
|
+
|
154
|
+
<a href="#process-instance_method" title="#process (instance method)">- (Object) <strong>process</strong>(key, options = {}) </a>
|
155
|
+
|
156
|
+
|
157
|
+
|
158
|
+
</span>
|
159
|
+
|
160
|
+
|
161
|
+
|
162
|
+
|
163
|
+
|
164
|
+
|
165
|
+
|
166
|
+
|
167
|
+
|
168
|
+
<span class="summary_desc"><div class='inline'>
|
169
|
+
<p>Checks if the given key is a datetime or not.</p>
|
170
|
+
</div></span>
|
171
|
+
|
172
|
+
</li>
|
173
|
+
|
174
|
+
|
175
|
+
</ul>
|
176
|
+
|
177
|
+
|
178
|
+
|
179
|
+
|
180
|
+
|
181
|
+
|
182
|
+
|
183
|
+
|
184
|
+
|
185
|
+
|
186
|
+
|
187
|
+
<h3 class="inherited">Methods inherited from <span class='object_link'><a href="../Processor.html" title="Kharon::Processor (class)">Kharon::Processor</a></span></h3>
|
188
|
+
<p class="inherited"><span class='object_link'><a href="../Processor.html#initialize-instance_method" title="Kharon::Processor#initialize (method)">#initialize</a></span></p>
|
189
|
+
<div id="constructor_details" class="method_details_list">
|
190
|
+
<h2>Constructor Details</h2>
|
191
|
+
|
192
|
+
<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>
|
193
|
+
|
194
|
+
</div>
|
195
|
+
|
196
|
+
|
197
|
+
<div id="instance_method_details" class="method_details_list">
|
198
|
+
<h2>Instance Method Details</h2>
|
199
|
+
|
200
|
+
|
201
|
+
<div class="method_details first">
|
202
|
+
<h3 class="signature first" id="process-instance_method">
|
203
|
+
|
204
|
+
- (<tt>Object</tt>) <strong>process</strong>(key, options = {})
|
205
|
+
|
206
|
+
|
207
|
+
|
208
|
+
|
209
|
+
|
210
|
+
</h3><div class="docstring">
|
211
|
+
<div class="discussion">
|
212
|
+
|
213
|
+
<p>Checks if the given key is a datetime or not.</p>
|
214
|
+
|
215
|
+
|
216
|
+
</div>
|
217
|
+
</div>
|
218
|
+
<div class="tags">
|
219
|
+
|
220
|
+
<div class="examples">
|
221
|
+
<p class="tag_title">Examples:</p>
|
222
|
+
|
223
|
+
|
224
|
+
<p class="example_title"><div class='inline'>
|
225
|
+
<p>Validates a key so it has to be a datetime, and depends on two other keys.</p>
|
226
|
+
</div></p>
|
227
|
+
|
228
|
+
<pre class="example code"><code><span class='ivar'>@validator</span><span class='period'>.</span><span class='id identifier rubyid_datetime'>datetime</span><span class='lparen'>(</span><span class='symbol'>:a_datetime</span><span class='comma'>,</span> <span class='label'>dependencies:</span> <span class='lbracket'>[</span><span class='symbol'>:another_key</span><span class='comma'>,</span> <span class='symbol'>:a_third_key</span><span class='rbracket'>]</span><span class='rparen'>)</span></code></pre>
|
229
|
+
|
230
|
+
</div>
|
231
|
+
<p class="tag_title">Parameters:</p>
|
232
|
+
<ul class="param">
|
233
|
+
|
234
|
+
<li>
|
235
|
+
|
236
|
+
<span class='name'>key</span>
|
237
|
+
|
238
|
+
|
239
|
+
<span class='type'>(<tt>Object</tt>)</span>
|
240
|
+
|
241
|
+
|
242
|
+
|
243
|
+
—
|
244
|
+
<div class='inline'>
|
245
|
+
<p>the key about which verify the type.</p>
|
246
|
+
</div>
|
247
|
+
|
248
|
+
</li>
|
249
|
+
|
250
|
+
<li>
|
251
|
+
|
252
|
+
<span class='name'>options</span>
|
253
|
+
|
254
|
+
|
255
|
+
<span class='type'>(<tt>Hash</tt>)</span>
|
256
|
+
|
257
|
+
|
258
|
+
<em class="default">(defaults to: <tt>{}</tt>)</em>
|
259
|
+
|
260
|
+
|
261
|
+
—
|
262
|
+
<div class='inline'>
|
263
|
+
<p>a hash of options passed to this method (see documentation to know which
|
264
|
+
options pass).</p>
|
265
|
+
</div>
|
266
|
+
|
267
|
+
</li>
|
268
|
+
|
269
|
+
</ul>
|
270
|
+
|
271
|
+
|
272
|
+
</div><table class="source_code">
|
273
|
+
<tr>
|
274
|
+
<td>
|
275
|
+
<pre class="lines">
|
276
|
+
|
277
|
+
|
278
|
+
15
|
279
|
+
16
|
280
|
+
17
|
281
|
+
18</pre>
|
282
|
+
</td>
|
283
|
+
<td>
|
284
|
+
<pre class="code"><span class="info file"># File 'lib/kharon/processors/date_processor.rb', line 15</span>
|
285
|
+
|
286
|
+
<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>
|
287
|
+
<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>
|
288
|
+
<span class='kw'>begin</span><span class='semicolon'>;</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='const'>Date</span><span class='period'>.</span><span class='id identifier rubyid_parse'>parse</span><span class='lparen'>(</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='rparen'>)</span><span class='rbrace'>}</span><span class='comma'>,</span> <span class='id identifier rubyid_options'>options</span><span class='rparen'>)</span><span class='semicolon'>;</span> <span class='kw'>rescue</span><span class='semicolon'>;</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'>Date</span><span class='tstring_end'>"</span></span><span class='rparen'>)</span><span class='semicolon'>;</span> <span class='kw'>end</span>
|
289
|
+
<span class='kw'>end</span></pre>
|
290
|
+
</td>
|
291
|
+
</tr>
|
292
|
+
</table>
|
293
|
+
</div>
|
294
|
+
|
295
|
+
</div>
|
296
|
+
|
297
|
+
</div>
|
298
|
+
|
299
|
+
<div id="footer">
|
300
|
+
Generated on Thu Jun 2 16:20:55 2016 by
|
301
|
+
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
302
|
+
0.8.7.6 (ruby-1.9.3).
|
303
|
+
</div>
|
304
|
+
|
305
|
+
</body>
|
306
|
+
</html>
|
@@ -0,0 +1,306 @@
|
|
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::DatetimeProcessor
|
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/DatetimeProcessor.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 (D)</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">DatetimeProcessor</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::DatetimeProcessor
|
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::DatetimeProcessor</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/datetime_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 datetimes. It only has the default options.</p>
|
108
|
+
|
109
|
+
|
110
|
+
</div>
|
111
|
+
</div>
|
112
|
+
<div class="tags">
|
113
|
+
|
114
|
+
<p class="tag_title">Author:</p>
|
115
|
+
<ul class="author">
|
116
|
+
|
117
|
+
<li>
|
118
|
+
|
119
|
+
|
120
|
+
|
121
|
+
|
122
|
+
|
123
|
+
<div class='inline'>
|
124
|
+
<p>Vincent Courtois <courtois.vincent@outlook.com></p>
|
125
|
+
</div>
|
126
|
+
|
127
|
+
</li>
|
128
|
+
|
129
|
+
</ul>
|
130
|
+
|
131
|
+
</div>
|
132
|
+
|
133
|
+
|
134
|
+
|
135
|
+
|
136
|
+
|
137
|
+
<h2>Instance Attribute Summary</h2>
|
138
|
+
|
139
|
+
<h3 class="inherited">Attributes inherited from <span class='object_link'><a href="../Processor.html" title="Kharon::Processor (class)">Kharon::Processor</a></span></h3>
|
140
|
+
<p class="inherited"><span class='object_link'><a href="../Processor.html#validator-instance_method" title="Kharon::Processor#validator (method)">#validator</a></span></p>
|
141
|
+
|
142
|
+
|
143
|
+
|
144
|
+
<h2>
|
145
|
+
Instance Method Summary
|
146
|
+
<small>(<a href="#" class="summary_toggle">collapse</a>)</small>
|
147
|
+
</h2>
|
148
|
+
|
149
|
+
<ul class="summary">
|
150
|
+
|
151
|
+
<li class="public ">
|
152
|
+
<span class="summary_signature">
|
153
|
+
|
154
|
+
<a href="#process-instance_method" title="#process (instance method)">- (Object) <strong>process</strong>(key, options = {}) </a>
|
155
|
+
|
156
|
+
|
157
|
+
|
158
|
+
</span>
|
159
|
+
|
160
|
+
|
161
|
+
|
162
|
+
|
163
|
+
|
164
|
+
|
165
|
+
|
166
|
+
|
167
|
+
|
168
|
+
<span class="summary_desc"><div class='inline'>
|
169
|
+
<p>Checks if the given key is a datetime or not.</p>
|
170
|
+
</div></span>
|
171
|
+
|
172
|
+
</li>
|
173
|
+
|
174
|
+
|
175
|
+
</ul>
|
176
|
+
|
177
|
+
|
178
|
+
|
179
|
+
|
180
|
+
|
181
|
+
|
182
|
+
|
183
|
+
|
184
|
+
|
185
|
+
|
186
|
+
|
187
|
+
<h3 class="inherited">Methods inherited from <span class='object_link'><a href="../Processor.html" title="Kharon::Processor (class)">Kharon::Processor</a></span></h3>
|
188
|
+
<p class="inherited"><span class='object_link'><a href="../Processor.html#initialize-instance_method" title="Kharon::Processor#initialize (method)">#initialize</a></span></p>
|
189
|
+
<div id="constructor_details" class="method_details_list">
|
190
|
+
<h2>Constructor Details</h2>
|
191
|
+
|
192
|
+
<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>
|
193
|
+
|
194
|
+
</div>
|
195
|
+
|
196
|
+
|
197
|
+
<div id="instance_method_details" class="method_details_list">
|
198
|
+
<h2>Instance Method Details</h2>
|
199
|
+
|
200
|
+
|
201
|
+
<div class="method_details first">
|
202
|
+
<h3 class="signature first" id="process-instance_method">
|
203
|
+
|
204
|
+
- (<tt>Object</tt>) <strong>process</strong>(key, options = {})
|
205
|
+
|
206
|
+
|
207
|
+
|
208
|
+
|
209
|
+
|
210
|
+
</h3><div class="docstring">
|
211
|
+
<div class="discussion">
|
212
|
+
|
213
|
+
<p>Checks if the given key is a datetime or not.</p>
|
214
|
+
|
215
|
+
|
216
|
+
</div>
|
217
|
+
</div>
|
218
|
+
<div class="tags">
|
219
|
+
|
220
|
+
<div class="examples">
|
221
|
+
<p class="tag_title">Examples:</p>
|
222
|
+
|
223
|
+
|
224
|
+
<p class="example_title"><div class='inline'>
|
225
|
+
<p>Validates a key so it has to be a datetime, and depends on two other keys.</p>
|
226
|
+
</div></p>
|
227
|
+
|
228
|
+
<pre class="example code"><code><span class='ivar'>@validator</span><span class='period'>.</span><span class='id identifier rubyid_datetime'>datetime</span><span class='lparen'>(</span><span class='symbol'>:a_datetime</span><span class='comma'>,</span> <span class='label'>dependencies:</span> <span class='lbracket'>[</span><span class='symbol'>:another_key</span><span class='comma'>,</span> <span class='symbol'>:a_third_key</span><span class='rbracket'>]</span><span class='rparen'>)</span></code></pre>
|
229
|
+
|
230
|
+
</div>
|
231
|
+
<p class="tag_title">Parameters:</p>
|
232
|
+
<ul class="param">
|
233
|
+
|
234
|
+
<li>
|
235
|
+
|
236
|
+
<span class='name'>key</span>
|
237
|
+
|
238
|
+
|
239
|
+
<span class='type'>(<tt>Object</tt>)</span>
|
240
|
+
|
241
|
+
|
242
|
+
|
243
|
+
—
|
244
|
+
<div class='inline'>
|
245
|
+
<p>the key about which verify the type.</p>
|
246
|
+
</div>
|
247
|
+
|
248
|
+
</li>
|
249
|
+
|
250
|
+
<li>
|
251
|
+
|
252
|
+
<span class='name'>options</span>
|
253
|
+
|
254
|
+
|
255
|
+
<span class='type'>(<tt>Hash</tt>)</span>
|
256
|
+
|
257
|
+
|
258
|
+
<em class="default">(defaults to: <tt>{}</tt>)</em>
|
259
|
+
|
260
|
+
|
261
|
+
—
|
262
|
+
<div class='inline'>
|
263
|
+
<p>a hash of options passed to this method (see documentation to know which
|
264
|
+
options pass).</p>
|
265
|
+
</div>
|
266
|
+
|
267
|
+
</li>
|
268
|
+
|
269
|
+
</ul>
|
270
|
+
|
271
|
+
|
272
|
+
</div><table class="source_code">
|
273
|
+
<tr>
|
274
|
+
<td>
|
275
|
+
<pre class="lines">
|
276
|
+
|
277
|
+
|
278
|
+
15
|
279
|
+
16
|
280
|
+
17
|
281
|
+
18</pre>
|
282
|
+
</td>
|
283
|
+
<td>
|
284
|
+
<pre class="code"><span class="info file"># File 'lib/kharon/processors/datetime_processor.rb', line 15</span>
|
285
|
+
|
286
|
+
<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>
|
287
|
+
<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>
|
288
|
+
<span class='kw'>begin</span><span class='semicolon'>;</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='const'>DateTime</span><span class='period'>.</span><span class='id identifier rubyid_parse'>parse</span><span class='lparen'>(</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='rparen'>)</span><span class='rbrace'>}</span> <span class='comma'>,</span> <span class='id identifier rubyid_options'>options</span><span class='rparen'>)</span><span class='semicolon'>;</span> <span class='kw'>rescue</span><span class='semicolon'>;</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'>DateTime</span><span class='tstring_end'>"</span></span><span class='rparen'>)</span><span class='semicolon'>;</span> <span class='kw'>end</span>
|
289
|
+
<span class='kw'>end</span></pre>
|
290
|
+
</td>
|
291
|
+
</tr>
|
292
|
+
</table>
|
293
|
+
</div>
|
294
|
+
|
295
|
+
</div>
|
296
|
+
|
297
|
+
</div>
|
298
|
+
|
299
|
+
<div id="footer">
|
300
|
+
Generated on Thu Jun 2 16:20:55 2016 by
|
301
|
+
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
302
|
+
0.8.7.6 (ruby-1.9.3).
|
303
|
+
</div>
|
304
|
+
|
305
|
+
</body>
|
306
|
+
</html>
|