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.
Files changed (52) hide show
  1. checksums.yaml +5 -13
  2. data/{.rspec → .rspec.old} +0 -0
  3. data/Gemfile +1 -0
  4. data/Gemfile.lock +12 -4
  5. data/dist/kharon-1.1.0.gem +0 -0
  6. data/doc/Kharon.html +384 -6
  7. data/doc/Kharon/Errors.html +1 -1
  8. data/doc/Kharon/Errors/Validation.html +1 -1
  9. data/doc/Kharon/Handlers.html +1 -1
  10. data/doc/Kharon/Handlers/Exceptions.html +1 -1
  11. data/doc/Kharon/Handlers/Messages.html +1 -1
  12. data/doc/Kharon/Processor.html +425 -0
  13. data/doc/Kharon/Processors.html +144 -0
  14. data/doc/Kharon/Processors/ArrayProcessor.html +429 -0
  15. data/doc/Kharon/Processors/BooleanProcessor.html +306 -0
  16. data/doc/Kharon/Processors/BoxProcessor.html +440 -0
  17. data/doc/Kharon/Processors/DateProcessor.html +306 -0
  18. data/doc/Kharon/Processors/DatetimeProcessor.html +306 -0
  19. data/doc/Kharon/Processors/EmailProcessor.html +307 -0
  20. data/doc/Kharon/Processors/HashProcessor.html +431 -0
  21. data/doc/Kharon/Processors/IntegerProcessor.html +441 -0
  22. data/doc/Kharon/Processors/NumericProcessor.html +463 -0
  23. data/doc/Kharon/Processors/SSIDProcessor.html +307 -0
  24. data/doc/Kharon/Processors/TextProcessor.html +430 -0
  25. data/doc/Kharon/Validate.html +17 -5
  26. data/doc/Kharon/Validator.html +198 -1194
  27. data/doc/_index.html +159 -1
  28. data/doc/class_list.html +1 -1
  29. data/doc/file.README.html +15 -4
  30. data/doc/index.html +15 -4
  31. data/doc/method_list.html +135 -39
  32. data/doc/top-level-namespace.html +1 -1
  33. data/kharon.gemspec +4 -2
  34. data/lib/kharon.rb +32 -2
  35. data/lib/kharon/processor.rb +162 -0
  36. data/lib/kharon/processors.rb +6 -0
  37. data/lib/kharon/processors/array_processor.rb +30 -0
  38. data/lib/kharon/processors/boolean_processor.rb +31 -0
  39. data/lib/kharon/processors/box_processor.rb +63 -0
  40. data/lib/kharon/processors/date_processor.rb +21 -0
  41. data/lib/kharon/processors/datetime_processor.rb +21 -0
  42. data/lib/kharon/processors/email_processor.rb +21 -0
  43. data/lib/kharon/processors/hash_processor.rb +31 -0
  44. data/lib/kharon/processors/integer_processor.rb +55 -0
  45. data/lib/kharon/processors/numeric_processor.rb +66 -0
  46. data/lib/kharon/processors/ssid_processor.rb +21 -0
  47. data/lib/kharon/processors/text_processor.rb +30 -0
  48. data/lib/kharon/validate.rb +1 -1
  49. data/lib/kharon/validator.rb +26 -390
  50. data/lib/kharon/version.rb +1 -1
  51. data/spec/results.html +5277 -321
  52. metadata +69 -28
@@ -0,0 +1,307 @@
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::SSIDProcessor
8
+
9
+ &mdash; 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/SSIDProcessor.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 (S)</a> &raquo;
35
+ <span class='title'><span class='object_link'><a href="../../Kharon.html" title="Kharon (module)">Kharon</a></span></span> &raquo; <span class='title'><span class='object_link'><a href="../Processors.html" title="Kharon::Processors (module)">Processors</a></span></span>
36
+ &raquo;
37
+ <span class="title">SSIDProcessor</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::SSIDProcessor
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::SSIDProcessor</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/ssid_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 MongoDB SSID. 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 &lt;courtois.vincent@outlook.com&gt;</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 not-empty string 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 not-empty string 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 string, and seems like and email address
226
+ (not sure of the regular expression though).</p>
227
+ </div></p>
228
+
229
+ <pre class="example code"><code><span class='ivar'>@validator</span><span class='period'>.</span><span class='id identifier rubyid_text'>text</span><span class='lparen'>(</span><span class='symbol'>:an_email</span><span class='comma'>,</span> <span class='label'>regex:</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>[a-zA-Z]+@[a-zA-Z]+\.[a-zA-Z]{2-4}</span><span class='tstring_end'>&quot;</span></span><span class='rparen'>)</span></code></pre>
230
+
231
+ </div>
232
+ <p class="tag_title">Parameters:</p>
233
+ <ul class="param">
234
+
235
+ <li>
236
+
237
+ <span class='name'>key</span>
238
+
239
+
240
+ <span class='type'>(<tt>Object</tt>)</span>
241
+
242
+
243
+
244
+ &mdash;
245
+ <div class='inline'>
246
+ <p>the key about which verify the type.</p>
247
+ </div>
248
+
249
+ </li>
250
+
251
+ <li>
252
+
253
+ <span class='name'>options</span>
254
+
255
+
256
+ <span class='type'>(<tt>Hash</tt>)</span>
257
+
258
+
259
+ <em class="default">(defaults to: <tt>{}</tt>)</em>
260
+
261
+
262
+ &mdash;
263
+ <div class='inline'>
264
+ <p>a hash of options passed to this method (see documentation to know which
265
+ options pass).</p>
266
+ </div>
267
+
268
+ </li>
269
+
270
+ </ul>
271
+
272
+
273
+ </div><table class="source_code">
274
+ <tr>
275
+ <td>
276
+ <pre class="lines">
277
+
278
+
279
+ 15
280
+ 16
281
+ 17
282
+ 18</pre>
283
+ </td>
284
+ <td>
285
+ <pre class="code"><span class="info file"># File 'lib/kharon/processors/ssid_processor.rb', line 15</span>
286
+
287
+ <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>
288
+ <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>
289
+ <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'>^[0-9a-fA-F]{24}$</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'>-&gt;</span><span class='lparen'>(</span><span class='id identifier rubyid_item'>item</span><span class='rparen'>)</span><span class='tlambeg'>{</span><span class='const'>BSON</span><span class='op'>::</span><span class='const'>ObjectId</span><span class='period'>.</span><span class='id identifier rubyid_from_string'>from_string</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='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'>&quot;</span><span class='tstring_content'>Moped::BSON::ObjectId</span><span class='tstring_end'>&quot;</span></span><span class='rparen'>)</span>
290
+ <span class='kw'>end</span></pre>
291
+ </td>
292
+ </tr>
293
+ </table>
294
+ </div>
295
+
296
+ </div>
297
+
298
+ </div>
299
+
300
+ <div id="footer">
301
+ Generated on Thu Jun 2 16:20:55 2016 by
302
+ <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
303
+ 0.8.7.6 (ruby-1.9.3).
304
+ </div>
305
+
306
+ </body>
307
+ </html>
@@ -0,0 +1,430 @@
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::TextProcessor
8
+
9
+ &mdash; 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/TextProcessor.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 (T)</a> &raquo;
35
+ <span class='title'><span class='object_link'><a href="../../Kharon.html" title="Kharon (module)">Kharon</a></span></span> &raquo; <span class='title'><span class='object_link'><a href="../Processors.html" title="Kharon::Processors (module)">Processors</a></span></span>
36
+ &raquo;
37
+ <span class="title">TextProcessor</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::TextProcessor
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::TextProcessor</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/text_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 simple strings. It has the :regex option plus the
108
+ 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 &lt;courtois.vincent@outlook.com&gt;</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 a not-empty string 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 string after verifying that it respects a regular expression given
195
+ in parameter.</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 a not-empty string 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 a string, and seems like and email address
252
+ (not sure of the regular expression though).</p>
253
+ </div></p>
254
+
255
+ <pre class="example code"><code><span class='ivar'>@validator</span><span class='period'>.</span><span class='id identifier rubyid_text'>text</span><span class='lparen'>(</span><span class='symbol'>:an_email</span><span class='comma'>,</span> <span class='label'>regex:</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>[a-zA-Z]+@[a-zA-Z]+\.[a-zA-Z]{2-4}</span><span class='tstring_end'>&quot;</span></span><span class='rparen'>)</span></code></pre>
256
+
257
+ </div>
258
+ <p class="tag_title">Parameters:</p>
259
+ <ul class="param">
260
+
261
+ <li>
262
+
263
+ <span class='name'>key</span>
264
+
265
+
266
+ <span class='type'>(<tt>Object</tt>)</span>
267
+
268
+
269
+
270
+ &mdash;
271
+ <div class='inline'>
272
+ <p>the key about which verify the type.</p>
273
+ </div>
274
+
275
+ </li>
276
+
277
+ <li>
278
+
279
+ <span class='name'>options</span>
280
+
281
+
282
+ <span class='type'>(<tt>Hash</tt>)</span>
283
+
284
+
285
+ <em class="default">(defaults to: <tt>{}</tt>)</em>
286
+
287
+
288
+ &mdash;
289
+ <div class='inline'>
290
+ <p>a hash of options passed to this method (see documentation to know which
291
+ options pass).</p>
292
+ </div>
293
+
294
+ </li>
295
+
296
+ </ul>
297
+
298
+
299
+ </div><table class="source_code">
300
+ <tr>
301
+ <td>
302
+ <pre class="lines">
303
+
304
+
305
+ 15
306
+ 16
307
+ 17
308
+ 18</pre>
309
+ </td>
310
+ <td>
311
+ <pre class="code"><span class="info file"># File 'lib/kharon/processors/text_processor.rb', line 15</span>
312
+
313
+ <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>
314
+ <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>
315
+ <span class='id identifier rubyid_is_typed?'>is_typed?</span><span class='lparen'>(</span><span class='id identifier rubyid_key'>key</span><span class='comma'>,</span> <span class='const'>String</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'>-&gt;</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='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'>&quot;</span><span class='tstring_content'>String</span><span class='tstring_end'>&quot;</span></span><span class='rparen'>)</span>
316
+ <span class='kw'>end</span></pre>
317
+ </td>
318
+ </tr>
319
+ </table>
320
+ </div>
321
+
322
+ <div class="method_details ">
323
+ <h3 class="signature " id="store-instance_method">
324
+
325
+ - (<tt>Object</tt>) <strong>store</strong>(key, process, options)
326
+
327
+
328
+
329
+
330
+
331
+ </h3><div class="docstring">
332
+ <div class="discussion">
333
+
334
+ <p>Stores a string after verifying that it respects a regular expression given
335
+ in parameter.</p>
336
+
337
+
338
+ </div>
339
+ </div>
340
+ <div class="tags">
341
+ <p class="tag_title">Parameters:</p>
342
+ <ul class="param">
343
+
344
+ <li>
345
+
346
+ <span class='name'>key</span>
347
+
348
+
349
+ <span class='type'>(<tt>Object</tt>)</span>
350
+
351
+
352
+
353
+ &mdash;
354
+ <div class='inline'>
355
+ <p>the key associated with the value to store in the filtered datas.</p>
356
+ </div>
357
+
358
+ </li>
359
+
360
+ <li>
361
+
362
+ <span class='name'>process</span>
363
+
364
+
365
+ <span class='type'>(<tt>Proc</tt>)</span>
366
+
367
+
368
+
369
+ &mdash;
370
+ <div class='inline'>
371
+ <p>a process (lambda) to execute on the initial value. Must contain strictly
372
+ one argument.</p>
373
+ </div>
374
+
375
+ </li>
376
+
377
+ <li>
378
+
379
+ <span class='name'>options</span>
380
+
381
+
382
+ <span class='type'>(<tt>Hash</tt>)</span>
383
+
384
+
385
+
386
+ &mdash;
387
+ <div class='inline'>
388
+ <p>the options applied to the initial value.</p>
389
+ </div>
390
+
391
+ </li>
392
+
393
+ </ul>
394
+
395
+
396
+ </div><table class="source_code">
397
+ <tr>
398
+ <td>
399
+ <pre class="lines">
400
+
401
+
402
+ 24
403
+ 25
404
+ 26
405
+ 27</pre>
406
+ </td>
407
+ <td>
408
+ <pre class="code"><span class="info file"># File 'lib/kharon/processors/text_processor.rb', line 24</span>
409
+
410
+ <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>
411
+ <span class='id identifier rubyid_match_regex?'>match_regex?</span><span class='lparen'>(</span><span class='id identifier rubyid_key'>key</span><span class='comma'>,</span> <span class='id identifier rubyid_validator'>validator</span><span class='period'>.</span><span class='id identifier rubyid_datas'>datas</span><span class='lbracket'>[</span><span class='id identifier rubyid_key'>key</span><span class='rbracket'>]</span><span class='comma'>,</span> <span class='id identifier rubyid_options'>options</span><span class='lbracket'>[</span><span class='symbol'>:regex</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'>:regex</span><span class='rparen'>)</span><span class='rparen'>)</span>
412
+ <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>
413
+ <span class='kw'>end</span></pre>
414
+ </td>
415
+ </tr>
416
+ </table>
417
+ </div>
418
+
419
+ </div>
420
+
421
+ </div>
422
+
423
+ <div id="footer">
424
+ Generated on Thu Jun 2 16:20:55 2016 by
425
+ <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
426
+ 0.8.7.6 (ruby-1.9.3).
427
+ </div>
428
+
429
+ </body>
430
+ </html>