schemacop 2.2.0 → 2.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (42) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +18 -0
  3. data/README.md +11 -6
  4. data/VERSION +1 -1
  5. data/doc/Schemacop.html +1 -1
  6. data/doc/Schemacop/ArrayValidator.html +1 -1
  7. data/doc/Schemacop/BooleanValidator.html +1 -1
  8. data/doc/Schemacop/Collector.html +206 -30
  9. data/doc/Schemacop/Exceptions.html +1 -1
  10. data/doc/Schemacop/Exceptions/InvalidSchemaError.html +1 -1
  11. data/doc/Schemacop/Exceptions/ValidationError.html +1 -1
  12. data/doc/Schemacop/FieldNode.html +1 -1
  13. data/doc/Schemacop/FloatValidator.html +1 -1
  14. data/doc/Schemacop/HashValidator.html +1 -1
  15. data/doc/Schemacop/IntegerValidator.html +1 -1
  16. data/doc/Schemacop/NilValidator.html +1 -1
  17. data/doc/Schemacop/Node.html +1 -1
  18. data/doc/Schemacop/NodeResolver.html +1 -1
  19. data/doc/Schemacop/NodeSupportingField.html +1 -1
  20. data/doc/Schemacop/NodeSupportingType.html +1 -1
  21. data/doc/Schemacop/NodeWithBlock.html +1 -1
  22. data/doc/Schemacop/NumberValidator.html +1 -1
  23. data/doc/Schemacop/ObjectValidator.html +18 -8
  24. data/doc/Schemacop/RootNode.html +1 -1
  25. data/doc/Schemacop/Schema.html +2 -2
  26. data/doc/Schemacop/StringValidator.html +1 -1
  27. data/doc/Schemacop/SymbolValidator.html +1 -1
  28. data/doc/ScopedEnv.html +1 -1
  29. data/doc/_index.html +1 -1
  30. data/doc/file.README.html +25 -18
  31. data/doc/index.html +25 -18
  32. data/doc/method_list.html +19 -3
  33. data/doc/top-level-namespace.html +1 -1
  34. data/lib/schemacop/collector.rb +21 -2
  35. data/lib/schemacop/node_supporting_field.rb +0 -2
  36. data/lib/schemacop/schema.rb +1 -1
  37. data/lib/schemacop/validator/object_validator.rb +7 -1
  38. data/schemacop.gemspec +5 -5
  39. data/test/collector_test.rb +45 -0
  40. data/test/short_forms_test.rb +15 -0
  41. data/test/validator_object_test.rb +18 -0
  42. metadata +5 -3
@@ -114,7 +114,7 @@
114
114
  </div>
115
115
 
116
116
  <div id="footer">
117
- Generated on Wed May 17 10:53:58 2017 by
117
+ Generated on Thu May 18 13:17:23 2017 by
118
118
  <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
119
119
  0.9.9 (ruby-2.3.1).
120
120
  </div>
@@ -399,7 +399,7 @@
399
399
  </div>
400
400
 
401
401
  <div id="footer">
402
- Generated on Wed May 17 10:53:58 2017 by
402
+ Generated on Thu May 18 13:17:23 2017 by
403
403
  <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
404
404
  0.9.9 (ruby-2.3.1).
405
405
  </div>
@@ -148,7 +148,7 @@
148
148
  </div>
149
149
 
150
150
  <div id="footer">
151
- Generated on Wed May 17 10:53:58 2017 by
151
+ Generated on Thu May 18 13:17:23 2017 by
152
152
  <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
153
153
  0.9.9 (ruby-2.3.1).
154
154
  </div>
@@ -279,7 +279,7 @@
279
279
  </div>
280
280
 
281
281
  <div id="footer">
282
- Generated on Wed May 17 10:53:58 2017 by
282
+ Generated on Thu May 18 13:17:23 2017 by
283
283
  <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
284
284
  0.9.9 (ruby-2.3.1).
285
285
  </div>
@@ -148,7 +148,7 @@
148
148
  </div>
149
149
 
150
150
  <div id="footer">
151
- Generated on Wed May 17 10:53:58 2017 by
151
+ Generated on Thu May 18 13:17:23 2017 by
152
152
  <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
153
153
  0.9.9 (ruby-2.3.1).
154
154
  </div>
@@ -135,7 +135,7 @@
135
135
  </div>
136
136
 
137
137
  <div id="footer">
138
- Generated on Wed May 17 10:53:58 2017 by
138
+ Generated on Thu May 18 13:17:23 2017 by
139
139
  <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
140
140
  0.9.9 (ruby-2.3.1).
141
141
  </div>
@@ -1416,7 +1416,7 @@
1416
1416
  </div>
1417
1417
 
1418
1418
  <div id="footer">
1419
- Generated on Wed May 17 10:53:58 2017 by
1419
+ Generated on Thu May 18 13:17:23 2017 by
1420
1420
  <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
1421
1421
  0.9.9 (ruby-2.3.1).
1422
1422
  </div>
@@ -232,7 +232,7 @@
232
232
  </div>
233
233
 
234
234
  <div id="footer">
235
- Generated on Wed May 17 10:53:58 2017 by
235
+ Generated on Thu May 18 13:17:23 2017 by
236
236
  <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
237
237
  0.9.9 (ruby-2.3.1).
238
238
  </div>
@@ -580,7 +580,7 @@
580
580
  </div>
581
581
 
582
582
  <div id="footer">
583
- Generated on Wed May 17 10:53:58 2017 by
583
+ Generated on Thu May 18 13:17:23 2017 by
584
584
  <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
585
585
  0.9.9 (ruby-2.3.1).
586
586
  </div>
@@ -604,7 +604,7 @@ as it formerly was the case in the constructor.</p>
604
604
  </div>
605
605
 
606
606
  <div id="footer">
607
- Generated on Wed May 17 10:53:58 2017 by
607
+ Generated on Thu May 18 13:17:23 2017 by
608
608
  <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
609
609
  0.9.9 (ruby-2.3.1).
610
610
  </div>
@@ -279,7 +279,7 @@
279
279
  </div>
280
280
 
281
281
  <div id="footer">
282
- Generated on Wed May 17 10:53:58 2017 by
282
+ Generated on Thu May 18 13:17:23 2017 by
283
283
  <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
284
284
  0.9.9 (ruby-2.3.1).
285
285
  </div>
@@ -222,7 +222,7 @@
222
222
  </div>
223
223
 
224
224
  <div id="footer">
225
- Generated on Wed May 17 10:53:58 2017 by
225
+ Generated on Thu May 18 13:17:23 2017 by
226
226
  <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
227
227
  0.9.9 (ruby-2.3.1).
228
228
  </div>
@@ -206,12 +206,12 @@
206
206
  <pre class="lines">
207
207
 
208
208
 
209
- 7
210
209
  8
211
- 9</pre>
210
+ 9
211
+ 10</pre>
212
212
  </td>
213
213
  <td>
214
- <pre class="code"><span class="info file"># File 'lib/schemacop/validator/object_validator.rb', line 7</span>
214
+ <pre class="code"><span class="info file"># File 'lib/schemacop/validator/object_validator.rb', line 8</span>
215
215
 
216
216
  <span class='kw'>def</span> <span class='id identifier rubyid_type_label'>type_label</span>
217
217
  <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='embexpr_beg'>#{</span><span class='kw'>super</span><span class='embexpr_end'>}</span><span class='tstring_content'> (</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_classes'>classes</span><span class='period'>.</span><span class='id identifier rubyid_join'>join</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>, </span><span class='tstring_end'>&#39;</span></span><span class='rparen'>)</span><span class='embexpr_end'>}</span><span class='tstring_content'>)</span><span class='tstring_end'>&quot;</span></span>
@@ -258,15 +258,25 @@
258
258
  <pre class="lines">
259
259
 
260
260
 
261
- 11
262
261
  12
263
- 13</pre>
262
+ 13
263
+ 14
264
+ 15
265
+ 16
266
+ 17
267
+ 18
268
+ 19</pre>
264
269
  </td>
265
270
  <td>
266
- <pre class="code"><span class="info file"># File 'lib/schemacop/validator/object_validator.rb', line 11</span>
271
+ <pre class="code"><span class="info file"># File 'lib/schemacop/validator/object_validator.rb', line 12</span>
267
272
 
268
273
  <span class='kw'>def</span> <span class='id identifier rubyid_type_matches?'>type_matches?</span><span class='lparen'>(</span><span class='id identifier rubyid_data'>data</span><span class='rparen'>)</span>
269
- <span class='kw'>super</span> <span class='op'>&amp;&amp;</span> <span class='lparen'>(</span><span class='id identifier rubyid_classes'>classes</span><span class='period'>.</span><span class='id identifier rubyid_empty?'>empty?</span> <span class='op'>||</span> <span class='id identifier rubyid_classes'>classes</span><span class='period'>.</span><span class='id identifier rubyid_include?'>include?</span><span class='lparen'>(</span><span class='id identifier rubyid_data'>data</span><span class='period'>.</span><span class='id identifier rubyid_class'>class</span><span class='rparen'>)</span><span class='rparen'>)</span> <span class='op'>&amp;&amp;</span> <span class='op'>!</span><span class='id identifier rubyid_data'>data</span><span class='period'>.</span><span class='id identifier rubyid_nil?'>nil?</span>
274
+ <span class='kw'>if</span> <span class='id identifier rubyid_option'>option</span><span class='lparen'>(</span><span class='symbol'>:strict</span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_is_a?'>is_a?</span><span class='lparen'>(</span><span class='const'>FalseClass</span><span class='rparen'>)</span>
275
+ <span class='id identifier rubyid_sub_or_class'>sub_or_class</span> <span class='op'>=</span> <span class='id identifier rubyid_classes'>classes</span><span class='period'>.</span><span class='id identifier rubyid_map'>map</span> <span class='lbrace'>{</span> <span class='op'>|</span><span class='id identifier rubyid_klass'>klass</span><span class='op'>|</span> <span class='id identifier rubyid_data'>data</span><span class='period'>.</span><span class='id identifier rubyid_class'>class</span> <span class='op'>&lt;=</span> <span class='id identifier rubyid_klass'>klass</span> <span class='rbrace'>}</span><span class='period'>.</span><span class='id identifier rubyid_include?'>include?</span><span class='lparen'>(</span><span class='kw'>true</span><span class='rparen'>)</span>
276
+ <span class='kw'>super</span> <span class='op'>&amp;&amp;</span> <span class='lparen'>(</span><span class='id identifier rubyid_classes'>classes</span><span class='period'>.</span><span class='id identifier rubyid_empty?'>empty?</span> <span class='op'>||</span> <span class='id identifier rubyid_sub_or_class'>sub_or_class</span><span class='rparen'>)</span> <span class='op'>&amp;&amp;</span> <span class='op'>!</span><span class='id identifier rubyid_data'>data</span><span class='period'>.</span><span class='id identifier rubyid_nil?'>nil?</span>
277
+ <span class='kw'>else</span>
278
+ <span class='kw'>super</span> <span class='op'>&amp;&amp;</span> <span class='lparen'>(</span><span class='id identifier rubyid_classes'>classes</span><span class='period'>.</span><span class='id identifier rubyid_empty?'>empty?</span> <span class='op'>||</span> <span class='id identifier rubyid_classes'>classes</span><span class='period'>.</span><span class='id identifier rubyid_include?'>include?</span><span class='lparen'>(</span><span class='id identifier rubyid_data'>data</span><span class='period'>.</span><span class='id identifier rubyid_class'>class</span><span class='rparen'>)</span><span class='rparen'>)</span> <span class='op'>&amp;&amp;</span> <span class='op'>!</span><span class='id identifier rubyid_data'>data</span><span class='period'>.</span><span class='id identifier rubyid_nil?'>nil?</span>
279
+ <span class='kw'>end</span>
270
280
  <span class='kw'>end</span></pre>
271
281
  </td>
272
282
  </tr>
@@ -278,7 +288,7 @@
278
288
  </div>
279
289
 
280
290
  <div id="footer">
281
- Generated on Wed May 17 10:53:58 2017 by
291
+ Generated on Thu May 18 13:17:23 2017 by
282
292
  <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
283
293
  0.9.9 (ruby-2.3.1).
284
294
  </div>
@@ -161,7 +161,7 @@
161
161
  </div>
162
162
 
163
163
  <div id="footer">
164
- Generated on Wed May 17 10:53:58 2017 by
164
+ Generated on Thu May 18 13:17:23 2017 by
165
165
  <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
166
166
  0.9.9 (ruby-2.3.1).
167
167
  </div>
@@ -568,7 +568,7 @@ throughout the validation.</p>
568
568
 
569
569
  <span class='kw'>def</span> <span class='id identifier rubyid_validate'>validate</span><span class='lparen'>(</span><span class='id identifier rubyid_data'>data</span><span class='rparen'>)</span>
570
570
  <span class='id identifier rubyid_collector'>collector</span> <span class='op'>=</span> <span class='const'><span class='object_link'><a href="Collector.html" title="Schemacop::Collector (class)">Collector</a></span></span><span class='period'>.</span><span class='id identifier rubyid_new'><span class='object_link'><a href="Collector.html#initialize-instance_method" title="Schemacop::Collector#initialize (method)">new</a></span></span>
571
- <span class='ivar'>@root</span><span class='period'>.</span><span class='id identifier rubyid_fields'>fields</span><span class='lbracket'>[</span><span class='symbol'>:root</span><span class='rbracket'>]</span><span class='period'>.</span><span class='id identifier rubyid_validate'>validate</span><span class='lparen'>(</span><span class='lbrace'>{</span> <span class='label'>root:</span> <span class='id identifier rubyid_data'>data</span> <span class='rbrace'>}</span><span class='comma'>,</span> <span class='id identifier rubyid_collector'>collector</span><span class='rparen'>)</span>
571
+ <span class='ivar'>@root</span><span class='period'>.</span><span class='id identifier rubyid_fields'>fields</span><span class='lbracket'>[</span><span class='symbol'>:root</span><span class='rbracket'>]</span><span class='period'>.</span><span class='id identifier rubyid_validate'>validate</span><span class='lparen'>(</span><span class='lbrace'>{</span> <span class='label'>root:</span> <span class='id identifier rubyid_data'>data</span> <span class='rbrace'>}</span><span class='comma'>,</span> <span class='id identifier rubyid_collector'>collector</span><span class='period'>.</span><span class='id identifier rubyid_ignore_next_segment'>ignore_next_segment</span><span class='rparen'>)</span>
572
572
  <span class='kw'>return</span> <span class='id identifier rubyid_collector'>collector</span>
573
573
  <span class='kw'>end</span></pre>
574
574
  </td>
@@ -687,7 +687,7 @@ this exception is thrown.</p>
687
687
  </div>
688
688
 
689
689
  <div id="footer">
690
- Generated on Wed May 17 10:53:58 2017 by
690
+ Generated on Thu May 18 13:17:23 2017 by
691
691
  <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
692
692
  0.9.9 (ruby-2.3.1).
693
693
  </div>
@@ -285,7 +285,7 @@
285
285
  </div>
286
286
 
287
287
  <div id="footer">
288
- Generated on Wed May 17 10:53:58 2017 by
288
+ Generated on Thu May 18 13:17:23 2017 by
289
289
  <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
290
290
  0.9.9 (ruby-2.3.1).
291
291
  </div>
@@ -135,7 +135,7 @@
135
135
  </div>
136
136
 
137
137
  <div id="footer">
138
- Generated on Wed May 17 10:53:58 2017 by
138
+ Generated on Thu May 18 13:17:23 2017 by
139
139
  <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
140
140
  0.9.9 (ruby-2.3.1).
141
141
  </div>
@@ -341,7 +341,7 @@
341
341
  </div>
342
342
 
343
343
  <div id="footer">
344
- Generated on Wed May 17 10:53:58 2017 by
344
+ Generated on Thu May 18 13:17:23 2017 by
345
345
  <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
346
346
  0.9.9 (ruby-2.3.1).
347
347
  </div>
@@ -347,7 +347,7 @@
347
347
  </div>
348
348
 
349
349
  <div id="footer">
350
- Generated on Wed May 17 10:53:58 2017 by
350
+ Generated on Thu May 18 13:17:23 2017 by
351
351
  <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
352
352
  0.9.9 (ruby-2.3.1).
353
353
  </div>
@@ -132,7 +132,7 @@ around at runtime. Those two steps look as follows:</p>
132
132
 
133
133
  <p>At runtime:</p>
134
134
 
135
- <pre class="code ruby"><code class="ruby"><span class='id identifier rubyid_my_shema'>my_shema</span><span class='period'>.</span><span class='id identifier rubyid_validate!'>validate!</span><span class='lparen'>(</span>
135
+ <pre class="code ruby"><code class="ruby"><span class='id identifier rubyid_my_schema'>my_schema</span><span class='period'>.</span><span class='id identifier rubyid_validate!'>validate!</span><span class='lparen'>(</span>
136
136
  <span class='comment'># Your data goes here
137
137
  </span><span class='rparen'>)</span>
138
138
  </code></pre>
@@ -386,31 +386,38 @@ Each validator is sourced by <code>schemacop.rb</code>.</p>
386
386
  <li>supported options: <code>min</code>, <code>max</code> (bounds for string length)</li>
387
387
  </ul></li>
388
388
  <li><p><code>:symbol</code> accepts a Ruby Symbol.</p></li>
389
- <li><p><code>:object</code> accepts an arbitrary Ruby object (any object if no option is given).</p>
389
+ <li><p><code>:object</code> accepts an arbitrary Ruby object (any object if no option is given).</p></li>
390
+ </ul>
391
+
392
+ <p>Supported options:</p>
390
393
 
391
394
  <ul>
392
- <li>supported option: <code>classes</code>: Ruby class (or an array of them) that will be
393
- the only recognized filters. Unlike other options, this one affects not the
394
- validation but the type recognition, meaning that you can have multiple Type
395
- Lines with different <code>classes</code> option for the same field, each having its
396
- own validation (e.g. through the option <code>check</code>).</li>
397
- </ul></li>
398
- <li><p><code>:array</code> accepts a Ruby Array.</p>
395
+ <li><p><code>classes</code>: Ruby class (or an array of them) that will be the only recognized
396
+ filters. Unlike other options, this one affects not the validation but the
397
+ type recognition, meaning that you can have multiple Type Lines with
398
+ different <code>classes</code> option for the same field, each having its own
399
+ validation (e.g. through the option <code>check</code>).</p></li>
400
+ <li><p><code>strict</code>: Boolean option, defaults to true. If set to false, the validator
401
+ also allows derived classes of those specified with <code>classes</code>.</p>
399
402
 
400
403
  <ul>
401
- <li>supported options: <code>min</code>, <code>max</code> (bounds for array size) and <code>nil</code>: TODO</li>
402
- <li>accepts a block with an arbitrary number of Type Lines.</li>
403
- <li>TODO no lookahead for different arrays, see
404
- validator_array_test#test_multiple_arrays</li>
404
+ <li><code>:array</code> accepts a Ruby Array.</li>
405
405
  </ul></li>
406
- <li><p><code>:hash</code> accepts a Ruby Hash or an <code>ActiveSupport::HashWithIndifferentAccess</code>.</p>
406
+ <li><p>supported options: <code>min</code>, <code>max</code> (bounds for array size) and <code>nil</code>: TODO</p></li>
407
+ <li><p>accepts a block with an arbitrary number of Type Lines.</p></li>
408
+ <li><p>TODO no lookahead for different arrays, see
409
+ validator_array_test#test_multiple_arrays</p>
407
410
 
408
411
  <ul>
409
- <li>accepts a block with an arbitrary number of Field Lines.</li>
412
+ <li><code>:hash</code> accepts a Ruby Hash or an <code>ActiveSupport::HashWithIndifferentAccess</code>.</li>
410
413
  </ul></li>
411
- <li><p><code>:nil</code>: accepts a Ruby NilClass instance. If you want to allow <code>nil</code> as a
414
+ <li><p>accepts a block with an arbitrary number of Field Lines.</p>
415
+
416
+ <ul>
417
+ <li><code>:nil</code>: accepts a Ruby NilClass instance. If you want to allow <code>nil</code> as a
412
418
  value in a field, see above for the usage of the suffixes <code>-!</code> and <code>-?</code> for
413
- Field Lines.</p></li>
419
+ Field Lines.</li>
420
+ </ul></li>
414
421
  </ul>
415
422
 
416
423
  <p>All types support the options <code>if</code> and <code>check</code> (see the section about Type Lines
@@ -619,7 +626,7 @@ to <a href="http://www.subgit.com/">SubGit</a> for their great open source licen
619
626
  </div></div>
620
627
 
621
628
  <div id="footer">
622
- Generated on Wed May 17 10:53:58 2017 by
629
+ Generated on Thu May 18 13:17:23 2017 by
623
630
  <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
624
631
  0.9.9 (ruby-2.3.1).
625
632
  </div>
@@ -132,7 +132,7 @@ around at runtime. Those two steps look as follows:</p>
132
132
 
133
133
  <p>At runtime:</p>
134
134
 
135
- <pre class="code ruby"><code class="ruby"><span class='id identifier rubyid_my_shema'>my_shema</span><span class='period'>.</span><span class='id identifier rubyid_validate!'>validate!</span><span class='lparen'>(</span>
135
+ <pre class="code ruby"><code class="ruby"><span class='id identifier rubyid_my_schema'>my_schema</span><span class='period'>.</span><span class='id identifier rubyid_validate!'>validate!</span><span class='lparen'>(</span>
136
136
  <span class='comment'># Your data goes here
137
137
  </span><span class='rparen'>)</span>
138
138
  </code></pre>
@@ -386,31 +386,38 @@ Each validator is sourced by <code>schemacop.rb</code>.</p>
386
386
  <li>supported options: <code>min</code>, <code>max</code> (bounds for string length)</li>
387
387
  </ul></li>
388
388
  <li><p><code>:symbol</code> accepts a Ruby Symbol.</p></li>
389
- <li><p><code>:object</code> accepts an arbitrary Ruby object (any object if no option is given).</p>
389
+ <li><p><code>:object</code> accepts an arbitrary Ruby object (any object if no option is given).</p></li>
390
+ </ul>
391
+
392
+ <p>Supported options:</p>
390
393
 
391
394
  <ul>
392
- <li>supported option: <code>classes</code>: Ruby class (or an array of them) that will be
393
- the only recognized filters. Unlike other options, this one affects not the
394
- validation but the type recognition, meaning that you can have multiple Type
395
- Lines with different <code>classes</code> option for the same field, each having its
396
- own validation (e.g. through the option <code>check</code>).</li>
397
- </ul></li>
398
- <li><p><code>:array</code> accepts a Ruby Array.</p>
395
+ <li><p><code>classes</code>: Ruby class (or an array of them) that will be the only recognized
396
+ filters. Unlike other options, this one affects not the validation but the
397
+ type recognition, meaning that you can have multiple Type Lines with
398
+ different <code>classes</code> option for the same field, each having its own
399
+ validation (e.g. through the option <code>check</code>).</p></li>
400
+ <li><p><code>strict</code>: Boolean option, defaults to true. If set to false, the validator
401
+ also allows derived classes of those specified with <code>classes</code>.</p>
399
402
 
400
403
  <ul>
401
- <li>supported options: <code>min</code>, <code>max</code> (bounds for array size) and <code>nil</code>: TODO</li>
402
- <li>accepts a block with an arbitrary number of Type Lines.</li>
403
- <li>TODO no lookahead for different arrays, see
404
- validator_array_test#test_multiple_arrays</li>
404
+ <li><code>:array</code> accepts a Ruby Array.</li>
405
405
  </ul></li>
406
- <li><p><code>:hash</code> accepts a Ruby Hash or an <code>ActiveSupport::HashWithIndifferentAccess</code>.</p>
406
+ <li><p>supported options: <code>min</code>, <code>max</code> (bounds for array size) and <code>nil</code>: TODO</p></li>
407
+ <li><p>accepts a block with an arbitrary number of Type Lines.</p></li>
408
+ <li><p>TODO no lookahead for different arrays, see
409
+ validator_array_test#test_multiple_arrays</p>
407
410
 
408
411
  <ul>
409
- <li>accepts a block with an arbitrary number of Field Lines.</li>
412
+ <li><code>:hash</code> accepts a Ruby Hash or an <code>ActiveSupport::HashWithIndifferentAccess</code>.</li>
410
413
  </ul></li>
411
- <li><p><code>:nil</code>: accepts a Ruby NilClass instance. If you want to allow <code>nil</code> as a
414
+ <li><p>accepts a block with an arbitrary number of Field Lines.</p>
415
+
416
+ <ul>
417
+ <li><code>:nil</code>: accepts a Ruby NilClass instance. If you want to allow <code>nil</code> as a
412
418
  value in a field, see above for the usage of the suffixes <code>-!</code> and <code>-?</code> for
413
- Field Lines.</p></li>
419
+ Field Lines.</li>
420
+ </ul></li>
414
421
  </ul>
415
422
 
416
423
  <p>All types support the options <code>if</code> and <code>check</code> (see the section about Type Lines
@@ -619,7 +626,7 @@ to <a href="http://www.subgit.com/">SubGit</a> for their great open source licen
619
626
  </div></div>
620
627
 
621
628
  <div id="footer">
622
- Generated on Wed May 17 10:53:58 2017 by
629
+ Generated on Thu May 18 13:17:23 2017 by
623
630
  <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
624
631
  0.9.9 (ruby-2.3.1).
625
632
  </div>
@@ -117,6 +117,14 @@
117
117
 
118
118
 
119
119
  <li class="even ">
120
+ <div class="item">
121
+ <span class='object_link'><a href="Schemacop/Collector.html#exceptions-instance_method" title="Schemacop::Collector#exceptions (method)">#exceptions</a></span>
122
+ <small>Schemacop::Collector</small>
123
+ </div>
124
+ </li>
125
+
126
+
127
+ <li class="odd ">
120
128
  <div class="item">
121
129
  <span class='object_link'><a href="Schemacop/Node.html#exec_block-instance_method" title="Schemacop::Node#exec_block (method)">#exec_block</a></span>
122
130
  <small>Schemacop::Node</small>
@@ -124,7 +132,7 @@
124
132
  </li>
125
133
 
126
134
 
127
- <li class="odd ">
135
+ <li class="even ">
128
136
  <div class="item">
129
137
  <span class='object_link'><a href="Schemacop/NodeWithBlock.html#exec_block-instance_method" title="Schemacop::NodeWithBlock#exec_block (method)">#exec_block</a></span>
130
138
  <small>Schemacop::NodeWithBlock</small>
@@ -132,7 +140,7 @@
132
140
  </li>
133
141
 
134
142
 
135
- <li class="even ">
143
+ <li class="odd ">
136
144
  <div class="item">
137
145
  <span class='object_link'><a href="Schemacop/NodeSupportingType.html#exec_block-instance_method" title="Schemacop::NodeSupportingType#exec_block (method)">#exec_block</a></span>
138
146
  <small>Schemacop::NodeSupportingType</small>
@@ -140,7 +148,7 @@
140
148
  </li>
141
149
 
142
150
 
143
- <li class="odd ">
151
+ <li class="even ">
144
152
  <div class="item">
145
153
  <span class='object_link'><a href="Schemacop/NodeSupportingField.html#fields-instance_method" title="Schemacop::NodeSupportingField#fields (method)">#fields</a></span>
146
154
  <small>Schemacop::NodeSupportingField</small>
@@ -148,6 +156,14 @@
148
156
  </li>
149
157
 
150
158
 
159
+ <li class="odd ">
160
+ <div class="item">
161
+ <span class='object_link'><a href="Schemacop/Collector.html#ignore_next_segment-instance_method" title="Schemacop::Collector#ignore_next_segment (method)">#ignore_next_segment</a></span>
162
+ <small>Schemacop::Collector</small>
163
+ </div>
164
+ </li>
165
+
166
+
151
167
  <li class="even ">
152
168
  <div class="item">
153
169
  <span class='object_link'><a href="Schemacop/Node.html#initialize-instance_method" title="Schemacop::Node#initialize (method)">#initialize</a></span>
@@ -102,7 +102,7 @@
102
102
  </div>
103
103
 
104
104
  <div id="footer">
105
- Generated on Wed May 17 10:53:58 2017 by
105
+ Generated on Thu May 18 13:17:23 2017 by
106
106
  <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
107
107
  0.9.9 (ruby-2.3.1).
108
108
  </div>