schemacop 2.1.0 → 2.4.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/CHANGELOG.md +58 -0
- data/LICENSE +1 -1
- data/README.md +250 -16
- data/RUBY_VERSION +1 -1
- data/Rakefile +6 -1
- data/VERSION +1 -1
- data/doc/Schemacop.html +32 -5
- data/doc/Schemacop/ArrayValidator.html +4 -4
- data/doc/Schemacop/BooleanValidator.html +4 -4
- data/doc/Schemacop/Caster.html +379 -0
- data/doc/Schemacop/Collector.html +298 -46
- data/doc/Schemacop/Exceptions.html +3 -3
- data/doc/Schemacop/Exceptions/InvalidSchemaError.html +3 -3
- data/doc/Schemacop/Exceptions/ValidationError.html +3 -3
- data/doc/Schemacop/FieldNode.html +19 -7
- data/doc/Schemacop/FloatValidator.html +4 -4
- data/doc/Schemacop/HashValidator.html +33 -7
- data/doc/Schemacop/IntegerValidator.html +4 -4
- data/doc/Schemacop/NilValidator.html +4 -4
- data/doc/Schemacop/Node.html +97 -85
- data/doc/Schemacop/NodeResolver.html +28 -12
- data/doc/Schemacop/NodeSupportingField.html +4 -4
- data/doc/Schemacop/NodeSupportingType.html +5 -7
- data/doc/Schemacop/NodeWithBlock.html +4 -4
- data/doc/Schemacop/NumberValidator.html +4 -4
- data/doc/Schemacop/ObjectValidator.html +20 -10
- data/doc/Schemacop/RootNode.html +4 -4
- data/doc/Schemacop/Schema.html +6 -6
- data/doc/Schemacop/StringValidator.html +3 -3
- data/doc/Schemacop/SymbolValidator.html +4 -4
- data/doc/ScopedEnv.html +3 -3
- data/doc/_index.html +11 -4
- data/doc/class_list.html +1 -1
- data/doc/css/style.css +10 -6
- data/doc/file.README.html +255 -29
- data/doc/frames.html +1 -1
- data/doc/index.html +255 -29
- data/doc/js/app.js +55 -0
- data/doc/method_list.html +99 -51
- data/doc/top-level-namespace.html +3 -3
- data/lib/schemacop.rb +15 -0
- data/lib/schemacop/caster.rb +38 -0
- data/lib/schemacop/collector.rb +53 -6
- data/lib/schemacop/field_node.rb +25 -3
- data/lib/schemacop/node.rb +16 -4
- data/lib/schemacop/node_resolver.rb +10 -2
- data/lib/schemacop/node_supporting_field.rb +0 -2
- data/lib/schemacop/node_supporting_type.rb +21 -1
- data/lib/schemacop/schema.rb +3 -3
- data/lib/schemacop/validator/array_validator.rb +1 -1
- data/lib/schemacop/validator/float_validator.rb +1 -1
- data/lib/schemacop/validator/hash_validator.rb +15 -2
- data/lib/schemacop/validator/integer_validator.rb +1 -1
- data/lib/schemacop/validator/object_validator.rb +7 -1
- data/schemacop.gemspec +15 -9
- data/test/casting_test.rb +90 -0
- data/test/collector_test.rb +45 -0
- data/test/custom_check_test.rb +20 -13
- data/test/custom_if_test.rb +12 -12
- data/test/defaults_test.rb +71 -0
- data/test/nil_dis_allow_test.rb +6 -6
- data/test/node_resolver_test.rb +26 -0
- data/test/short_forms_test.rb +86 -64
- data/test/test_helper.rb +7 -0
- data/test/types_test.rb +5 -5
- data/test/validator_array_test.rb +16 -16
- data/test/validator_boolean_test.rb +2 -2
- data/test/validator_float_test.rb +15 -15
- data/test/validator_hash_test.rb +5 -5
- data/test/validator_integer_test.rb +9 -9
- data/test/validator_nil_test.rb +1 -1
- data/test/validator_number_test.rb +19 -19
- data/test/validator_object_test.rb +33 -15
- data/test/validator_string_test.rb +12 -12
- data/test/validator_symbol_test.rb +2 -2
- metadata +43 -6
@@ -6,7 +6,7 @@
|
|
6
6
|
<title>
|
7
7
|
Module: Schemacop::Exceptions
|
8
8
|
|
9
|
-
— Documentation by YARD 0.9.
|
9
|
+
— Documentation by YARD 0.9.20
|
10
10
|
|
11
11
|
</title>
|
12
12
|
|
@@ -105,9 +105,9 @@
|
|
105
105
|
</div>
|
106
106
|
|
107
107
|
<div id="footer">
|
108
|
-
Generated on
|
108
|
+
Generated on Mon Oct 28 16:21:59 2019 by
|
109
109
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
110
|
-
0.9.
|
110
|
+
0.9.20 (ruby-2.6.2).
|
111
111
|
</div>
|
112
112
|
|
113
113
|
</div>
|
@@ -6,7 +6,7 @@
|
|
6
6
|
<title>
|
7
7
|
Exception: Schemacop::Exceptions::InvalidSchemaError
|
8
8
|
|
9
|
-
— Documentation by YARD 0.9.
|
9
|
+
— Documentation by YARD 0.9.20
|
10
10
|
|
11
11
|
</title>
|
12
12
|
|
@@ -114,9 +114,9 @@
|
|
114
114
|
</div>
|
115
115
|
|
116
116
|
<div id="footer">
|
117
|
-
Generated on
|
117
|
+
Generated on Mon Oct 28 16:21:59 2019 by
|
118
118
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
119
|
-
0.9.
|
119
|
+
0.9.20 (ruby-2.6.2).
|
120
120
|
</div>
|
121
121
|
|
122
122
|
</div>
|
@@ -6,7 +6,7 @@
|
|
6
6
|
<title>
|
7
7
|
Exception: Schemacop::Exceptions::ValidationError
|
8
8
|
|
9
|
-
— Documentation by YARD 0.9.
|
9
|
+
— Documentation by YARD 0.9.20
|
10
10
|
|
11
11
|
</title>
|
12
12
|
|
@@ -114,9 +114,9 @@
|
|
114
114
|
</div>
|
115
115
|
|
116
116
|
<div id="footer">
|
117
|
-
Generated on
|
117
|
+
Generated on Mon Oct 28 16:21:59 2019 by
|
118
118
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
119
|
-
0.9.
|
119
|
+
0.9.20 (ruby-2.6.2).
|
120
120
|
</div>
|
121
121
|
|
122
122
|
</div>
|
@@ -6,7 +6,7 @@
|
|
6
6
|
<title>
|
7
7
|
Class: Schemacop::FieldNode
|
8
8
|
|
9
|
-
— Documentation by YARD 0.9.
|
9
|
+
— Documentation by YARD 0.9.20
|
10
10
|
|
11
11
|
</title>
|
12
12
|
|
@@ -375,7 +375,13 @@
|
|
375
375
|
21
|
376
376
|
22
|
377
377
|
23
|
378
|
-
24
|
378
|
+
24
|
379
|
+
25
|
380
|
+
26
|
381
|
+
27
|
382
|
+
28
|
383
|
+
29
|
384
|
+
30</pre>
|
379
385
|
</td>
|
380
386
|
<td>
|
381
387
|
<pre class="code"><span class="info file"># File 'lib/schemacop/field_node.rb', line 16</span>
|
@@ -383,10 +389,16 @@
|
|
383
389
|
<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='comma'>,</span> <span class='id identifier rubyid_collector'>collector</span><span class='rparen'>)</span>
|
384
390
|
<span class='kw'>unless</span> <span class='id identifier rubyid_data'>data</span><span class='period'>.</span><span class='id identifier rubyid_key?'>key?</span><span class='lparen'>(</span><span class='id identifier rubyid_name'>name</span><span class='rparen'>)</span>
|
385
391
|
<span class='id identifier rubyid_collector'>collector</span><span class='period'>.</span><span class='id identifier rubyid_error'>error</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>Missing key </span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_name'>name</span><span class='period'>.</span><span class='id identifier rubyid_inspect'>inspect</span><span class='embexpr_end'>}</span><span class='tstring_content'>.</span><span class='tstring_end'>"</span></span> <span class='kw'>if</span> <span class='ivar'>@required</span>
|
386
|
-
<span class='kw'>return</span>
|
387
392
|
<span class='kw'>end</span>
|
388
|
-
|
389
|
-
|
393
|
+
|
394
|
+
<span class='id identifier rubyid_collector'>collector</span><span class='period'>.</span><span class='id identifier rubyid_path'>path</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>/</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_name'>name</span><span class='embexpr_end'>}</span><span class='tstring_end'>"</span></span><span class='comma'>,</span> <span class='id identifier rubyid_name'>name</span><span class='comma'>,</span> <span class='symbol'>:hash</span> <span class='kw'>do</span>
|
395
|
+
<span class='id identifier rubyid_value'>value</span><span class='comma'>,</span> <span class='id identifier rubyid_default_applied'>default_applied</span> <span class='op'>=</span> <span class='id identifier rubyid_apply_default!'>apply_default!</span><span class='lparen'>(</span><span class='id identifier rubyid_data'>data</span><span class='lbracket'>[</span><span class='id identifier rubyid_name'>name</span><span class='rbracket'>]</span><span class='comma'>,</span> <span class='id identifier rubyid_collector'>collector</span><span class='rparen'>)</span>
|
396
|
+
|
397
|
+
<span class='kw'>unless</span> <span class='id identifier rubyid_data'>data</span><span class='period'>.</span><span class='id identifier rubyid_key?'>key?</span><span class='lparen'>(</span><span class='id identifier rubyid_name'>name</span><span class='rparen'>)</span> <span class='op'>||</span> <span class='id identifier rubyid_default_applied'>default_applied</span>
|
398
|
+
<span class='kw'>next</span>
|
399
|
+
<span class='kw'>end</span>
|
400
|
+
|
401
|
+
<span class='kw'>super</span><span class='lparen'>(</span><span class='id identifier rubyid_value'>value</span><span class='comma'>,</span> <span class='id identifier rubyid_collector'>collector</span><span class='rparen'>)</span>
|
390
402
|
<span class='kw'>end</span>
|
391
403
|
<span class='kw'>end</span></pre>
|
392
404
|
</td>
|
@@ -399,9 +411,9 @@
|
|
399
411
|
</div>
|
400
412
|
|
401
413
|
<div id="footer">
|
402
|
-
Generated on
|
414
|
+
Generated on Mon Oct 28 16:21:59 2019 by
|
403
415
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
404
|
-
0.9.
|
416
|
+
0.9.20 (ruby-2.6.2).
|
405
417
|
</div>
|
406
418
|
|
407
419
|
</div>
|
@@ -6,7 +6,7 @@
|
|
6
6
|
<title>
|
7
7
|
Class: Schemacop::FloatValidator
|
8
8
|
|
9
|
-
— Documentation by YARD 0.9.
|
9
|
+
— Documentation by YARD 0.9.20
|
10
10
|
|
11
11
|
</title>
|
12
12
|
|
@@ -136,7 +136,7 @@
|
|
136
136
|
|
137
137
|
|
138
138
|
<h3 class="inherited">Methods inherited from <span class='object_link'><a href="Node.html" title="Schemacop::Node (class)">Node</a></span></h3>
|
139
|
-
<p class="inherited"><span class='object_link'><a href="Node.html#build-class_method" title="Schemacop::Node.build (method)">build</a></span>, <span class='object_link'><a href="Node.html#class_matches%3F-class_method" title="Schemacop::Node.class_matches? (method)">class_matches?</a></span>, <span class='object_link'><a href="Node.html#clear_klasses-class_method" title="Schemacop::Node.clear_klasses (method)">clear_klasses</a></span>, <span class='object_link'><a href="Node.html#clear_symbols-class_method" title="Schemacop::Node.clear_symbols (method)">clear_symbols</a></span>, <span class='object_link'><a href="Node.html#exec_block-instance_method" title="Schemacop::Node#exec_block (method)">#exec_block</a></span>, <span class='object_link'><a href="Node.html#initialize-instance_method" title="Schemacop::Node#initialize (method)">#initialize</a></span>, <span class='object_link'><a href="Node.html#klass-class_method" title="Schemacop::Node.klass (method)">klass</a></span>, <span class='object_link'><a href="Node.html#option-class_method" title="Schemacop::Node.option (method)">option</a></span>, <span class='object_link'><a href="Node.html#option-instance_method" title="Schemacop::Node#option (method)">#option</a></span>, <span class='object_link'><a href="Node.html#option%3F-instance_method" title="Schemacop::Node#option? (method)">#option?</a></span>, <span class='object_link'><a href="Node.html#register-class_method" title="Schemacop::Node.register (method)">register</a></span>, <span class='object_link'><a href="Node.html#resolve_type_klass-instance_method" title="Schemacop::Node#resolve_type_klass (method)">#resolve_type_klass</a></span>, <span class='object_link'><a href="Node.html#symbol-class_method" title="Schemacop::Node.symbol (method)">symbol</a></span>, <span class='object_link'><a href="Node.html#symbol_matches%3F-class_method" title="Schemacop::Node.symbol_matches? (method)">symbol_matches?</a></span>, <span class='object_link'><a href="Node.html#type_filter_matches%3F-instance_method" title="Schemacop::Node#type_filter_matches? (method)">#type_filter_matches?</a></span>, <span class='object_link'><a href="Node.html#type_label-instance_method" title="Schemacop::Node#type_label (method)">#type_label</a></span>, <span class='object_link'><a href="Node.html#type_matches%3F-
|
139
|
+
<p class="inherited"><span class='object_link'><a href="Node.html#build-class_method" title="Schemacop::Node.build (method)">build</a></span>, <span class='object_link'><a href="Node.html#class_matches%3F-class_method" title="Schemacop::Node.class_matches? (method)">class_matches?</a></span>, <span class='object_link'><a href="Node.html#clear_klasses-class_method" title="Schemacop::Node.clear_klasses (method)">clear_klasses</a></span>, <span class='object_link'><a href="Node.html#clear_symbols-class_method" title="Schemacop::Node.clear_symbols (method)">clear_symbols</a></span>, <span class='object_link'><a href="Node.html#exec_block-instance_method" title="Schemacop::Node#exec_block (method)">#exec_block</a></span>, <span class='object_link'><a href="Node.html#initialize-instance_method" title="Schemacop::Node#initialize (method)">#initialize</a></span>, <span class='object_link'><a href="Node.html#klass-class_method" title="Schemacop::Node.klass (method)">klass</a></span>, <span class='object_link'><a href="Node.html#option-class_method" title="Schemacop::Node.option (method)">option</a></span>, <span class='object_link'><a href="Node.html#option-instance_method" title="Schemacop::Node#option (method)">#option</a></span>, <span class='object_link'><a href="Node.html#option%3F-instance_method" title="Schemacop::Node#option? (method)">#option?</a></span>, <span class='object_link'><a href="Node.html#register-class_method" title="Schemacop::Node.register (method)">register</a></span>, <span class='object_link'><a href="Node.html#resolve_type_klass-instance_method" title="Schemacop::Node#resolve_type_klass (method)">#resolve_type_klass</a></span>, <span class='object_link'><a href="Node.html#symbol-class_method" title="Schemacop::Node.symbol (method)">symbol</a></span>, <span class='object_link'><a href="Node.html#symbol_matches%3F-class_method" title="Schemacop::Node.symbol_matches? (method)">symbol_matches?</a></span>, <span class='object_link'><a href="Node.html#type_filter_matches%3F-instance_method" title="Schemacop::Node#type_filter_matches? (method)">#type_filter_matches?</a></span>, <span class='object_link'><a href="Node.html#type_label-instance_method" title="Schemacop::Node#type_label (method)">#type_label</a></span>, <span class='object_link'><a href="Node.html#type_matches%3F-instance_method" title="Schemacop::Node#type_matches? (method)">#type_matches?</a></span>, <span class='object_link'><a href="Node.html#type_matches%3F-class_method" title="Schemacop::Node.type_matches? (method)">type_matches?</a></span>, <span class='object_link'><a href="Node.html#validate-instance_method" title="Schemacop::Node#validate (method)">#validate</a></span></p>
|
140
140
|
<div id="constructor_details" class="method_details_list">
|
141
141
|
<h2>Constructor Details</h2>
|
142
142
|
|
@@ -148,9 +148,9 @@
|
|
148
148
|
</div>
|
149
149
|
|
150
150
|
<div id="footer">
|
151
|
-
Generated on
|
151
|
+
Generated on Mon Oct 28 16:21:59 2019 by
|
152
152
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
153
|
-
0.9.
|
153
|
+
0.9.20 (ruby-2.6.2).
|
154
154
|
</div>
|
155
155
|
|
156
156
|
</div>
|
@@ -6,7 +6,7 @@
|
|
6
6
|
<title>
|
7
7
|
Class: Schemacop::HashValidator
|
8
8
|
|
9
|
-
— Documentation by YARD 0.9.
|
9
|
+
— Documentation by YARD 0.9.20
|
10
10
|
|
11
11
|
</title>
|
12
12
|
|
@@ -187,7 +187,7 @@
|
|
187
187
|
|
188
188
|
|
189
189
|
<h3 class="inherited">Methods inherited from <span class='object_link'><a href="Node.html" title="Schemacop::Node (class)">Node</a></span></h3>
|
190
|
-
<p class="inherited"><span class='object_link'><a href="Node.html#build-class_method" title="Schemacop::Node.build (method)">build</a></span>, <span class='object_link'><a href="Node.html#class_matches%3F-class_method" title="Schemacop::Node.class_matches? (method)">class_matches?</a></span>, <span class='object_link'><a href="Node.html#clear_klasses-class_method" title="Schemacop::Node.clear_klasses (method)">clear_klasses</a></span>, <span class='object_link'><a href="Node.html#clear_symbols-class_method" title="Schemacop::Node.clear_symbols (method)">clear_symbols</a></span>, <span class='object_link'><a href="Node.html#exec_block-instance_method" title="Schemacop::Node#exec_block (method)">#exec_block</a></span>, <span class='object_link'><a href="Node.html#initialize-instance_method" title="Schemacop::Node#initialize (method)">#initialize</a></span>, <span class='object_link'><a href="Node.html#klass-class_method" title="Schemacop::Node.klass (method)">klass</a></span>, <span class='object_link'><a href="Node.html#option-class_method" title="Schemacop::Node.option (method)">option</a></span>, <span class='object_link'><a href="Node.html#option-instance_method" title="Schemacop::Node#option (method)">#option</a></span>, <span class='object_link'><a href="Node.html#option%3F-instance_method" title="Schemacop::Node#option? (method)">#option?</a></span>, <span class='object_link'><a href="Node.html#register-class_method" title="Schemacop::Node.register (method)">register</a></span>, <span class='object_link'><a href="Node.html#resolve_type_klass-instance_method" title="Schemacop::Node#resolve_type_klass (method)">#resolve_type_klass</a></span>, <span class='object_link'><a href="Node.html#symbol-class_method" title="Schemacop::Node.symbol (method)">symbol</a></span>, <span class='object_link'><a href="Node.html#symbol_matches%3F-class_method" title="Schemacop::Node.symbol_matches? (method)">symbol_matches?</a></span>, <span class='object_link'><a href="Node.html#type_filter_matches%3F-instance_method" title="Schemacop::Node#type_filter_matches? (method)">#type_filter_matches?</a></span>, <span class='object_link'><a href="Node.html#type_label-instance_method" title="Schemacop::Node#type_label (method)">#type_label</a></span>, <span class='object_link'><a href="Node.html#type_matches%3F-
|
190
|
+
<p class="inherited"><span class='object_link'><a href="Node.html#build-class_method" title="Schemacop::Node.build (method)">build</a></span>, <span class='object_link'><a href="Node.html#class_matches%3F-class_method" title="Schemacop::Node.class_matches? (method)">class_matches?</a></span>, <span class='object_link'><a href="Node.html#clear_klasses-class_method" title="Schemacop::Node.clear_klasses (method)">clear_klasses</a></span>, <span class='object_link'><a href="Node.html#clear_symbols-class_method" title="Schemacop::Node.clear_symbols (method)">clear_symbols</a></span>, <span class='object_link'><a href="Node.html#exec_block-instance_method" title="Schemacop::Node#exec_block (method)">#exec_block</a></span>, <span class='object_link'><a href="Node.html#initialize-instance_method" title="Schemacop::Node#initialize (method)">#initialize</a></span>, <span class='object_link'><a href="Node.html#klass-class_method" title="Schemacop::Node.klass (method)">klass</a></span>, <span class='object_link'><a href="Node.html#option-class_method" title="Schemacop::Node.option (method)">option</a></span>, <span class='object_link'><a href="Node.html#option-instance_method" title="Schemacop::Node#option (method)">#option</a></span>, <span class='object_link'><a href="Node.html#option%3F-instance_method" title="Schemacop::Node#option? (method)">#option?</a></span>, <span class='object_link'><a href="Node.html#register-class_method" title="Schemacop::Node.register (method)">register</a></span>, <span class='object_link'><a href="Node.html#resolve_type_klass-instance_method" title="Schemacop::Node#resolve_type_klass (method)">#resolve_type_klass</a></span>, <span class='object_link'><a href="Node.html#symbol-class_method" title="Schemacop::Node.symbol (method)">symbol</a></span>, <span class='object_link'><a href="Node.html#symbol_matches%3F-class_method" title="Schemacop::Node.symbol_matches? (method)">symbol_matches?</a></span>, <span class='object_link'><a href="Node.html#type_filter_matches%3F-instance_method" title="Schemacop::Node#type_filter_matches? (method)">#type_filter_matches?</a></span>, <span class='object_link'><a href="Node.html#type_label-instance_method" title="Schemacop::Node#type_label (method)">#type_label</a></span>, <span class='object_link'><a href="Node.html#type_matches%3F-instance_method" title="Schemacop::Node#type_matches? (method)">#type_matches?</a></span>, <span class='object_link'><a href="Node.html#type_matches%3F-class_method" title="Schemacop::Node.type_matches? (method)">type_matches?</a></span></p>
|
191
191
|
<div id="constructor_details" class="method_details_list">
|
192
192
|
<h2>Constructor Details</h2>
|
193
193
|
|
@@ -226,7 +226,20 @@
|
|
226
226
|
13
|
227
227
|
14
|
228
228
|
15
|
229
|
-
16
|
229
|
+
16
|
230
|
+
17
|
231
|
+
18
|
232
|
+
19
|
233
|
+
20
|
234
|
+
21
|
235
|
+
22
|
236
|
+
23
|
237
|
+
24
|
238
|
+
25
|
239
|
+
26
|
240
|
+
27
|
241
|
+
28
|
242
|
+
29</pre>
|
230
243
|
</td>
|
231
244
|
<td>
|
232
245
|
<pre class="code"><span class="info file"># File 'lib/schemacop/validator/hash_validator.rb', line 5</span>
|
@@ -234,8 +247,21 @@
|
|
234
247
|
<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='comma'>,</span> <span class='id identifier rubyid_collector'>collector</span><span class='rparen'>)</span>
|
235
248
|
<span class='kw'>super</span>
|
236
249
|
|
237
|
-
<span class='id identifier
|
238
|
-
|
250
|
+
<span class='kw'>if</span> <span class='id identifier rubyid_data'>data</span><span class='period'>.</span><span class='id identifier rubyid_is_a?'>is_a?</span> <span class='const'>ActiveSupport</span><span class='op'>::</span><span class='const'>HashWithIndifferentAccess</span>
|
251
|
+
<span class='id identifier rubyid_allowed_fields'>allowed_fields</span> <span class='op'>=</span> <span class='ivar'>@fields</span><span class='period'>.</span><span class='id identifier rubyid_keys'>keys</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_k'>k</span><span class='op'>|</span> <span class='id identifier rubyid_k'>k</span><span class='period'>.</span><span class='id identifier rubyid_is_a?'>is_a?</span><span class='lparen'>(</span><span class='const'>String</span><span class='rparen'>)</span> <span class='op'>?</span> <span class='id identifier rubyid_k'>k</span><span class='period'>.</span><span class='id identifier rubyid_to_sym'>to_sym</span> <span class='op'>:</span> <span class='id identifier rubyid_k'>k</span> <span class='rbrace'>}</span>
|
252
|
+
<span class='id identifier rubyid_data_keys'>data_keys</span> <span class='op'>=</span> <span class='id identifier rubyid_data'>data</span><span class='period'>.</span><span class='id identifier rubyid_keys'>keys</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_k'>k</span><span class='op'>|</span> <span class='id identifier rubyid_k'>k</span><span class='period'>.</span><span class='id identifier rubyid_is_a?'>is_a?</span><span class='lparen'>(</span><span class='const'>String</span><span class='rparen'>)</span> <span class='op'>?</span> <span class='id identifier rubyid_k'>k</span><span class='period'>.</span><span class='id identifier rubyid_to_sym'>to_sym</span> <span class='op'>:</span> <span class='id identifier rubyid_k'>k</span> <span class='rbrace'>}</span>
|
253
|
+
|
254
|
+
<span class='comment'># If the same key is specified in the schema as string and symbol, we
|
255
|
+
</span> <span class='comment'># definitely expect a Ruby hash and not one with indifferent access
|
256
|
+
</span> <span class='kw'>if</span> <span class='ivar'>@fields</span><span class='period'>.</span><span class='id identifier rubyid_keys'>keys</span><span class='period'>.</span><span class='id identifier rubyid_length'>length</span> <span class='op'>!=</span> <span class='const'>Set</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span><span class='lparen'>(</span><span class='id identifier rubyid_allowed_fields'>allowed_fields</span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_length'>length</span>
|
257
|
+
<span class='id identifier rubyid_fail'>fail</span> <span class='const'><span class='object_link'><a href="Exceptions.html" title="Schemacop::Exceptions (module)">Exceptions</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="Exceptions/ValidationError.html" title="Schemacop::Exceptions::ValidationError (class)">ValidationError</a></span></span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>Hash expected, but got ActiveSupport::HashWithIndifferentAccess.</span><span class='tstring_end'>'</span></span>
|
258
|
+
<span class='kw'>end</span>
|
259
|
+
<span class='kw'>else</span>
|
260
|
+
<span class='id identifier rubyid_allowed_fields'>allowed_fields</span> <span class='op'>=</span> <span class='ivar'>@fields</span><span class='period'>.</span><span class='id identifier rubyid_keys'>keys</span>
|
261
|
+
<span class='id identifier rubyid_data_keys'>data_keys</span> <span class='op'>=</span> <span class='id identifier rubyid_data'>data</span><span class='period'>.</span><span class='id identifier rubyid_keys'>keys</span>
|
262
|
+
<span class='kw'>end</span>
|
263
|
+
|
264
|
+
<span class='id identifier rubyid_obsolete_keys'>obsolete_keys</span> <span class='op'>=</span> <span class='id identifier rubyid_data_keys'>data_keys</span> <span class='op'>-</span> <span class='id identifier rubyid_allowed_fields'>allowed_fields</span>
|
239
265
|
|
240
266
|
<span class='id identifier rubyid_collector'>collector</span><span class='period'>.</span><span class='id identifier rubyid_error'>error</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>Obsolete keys: </span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_obsolete_keys'>obsolete_keys</span><span class='period'>.</span><span class='id identifier rubyid_inspect'>inspect</span><span class='embexpr_end'>}</span><span class='tstring_content'>.</span><span class='tstring_end'>"</span></span> <span class='kw'>if</span> <span class='id identifier rubyid_obsolete_keys'>obsolete_keys</span><span class='period'>.</span><span class='id identifier rubyid_any?'>any?</span>
|
241
267
|
|
@@ -253,9 +279,9 @@
|
|
253
279
|
</div>
|
254
280
|
|
255
281
|
<div id="footer">
|
256
|
-
Generated on
|
282
|
+
Generated on Mon Oct 28 16:21:59 2019 by
|
257
283
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
258
|
-
0.9.
|
284
|
+
0.9.20 (ruby-2.6.2).
|
259
285
|
</div>
|
260
286
|
|
261
287
|
</div>
|
@@ -6,7 +6,7 @@
|
|
6
6
|
<title>
|
7
7
|
Class: Schemacop::IntegerValidator
|
8
8
|
|
9
|
-
— Documentation by YARD 0.9.
|
9
|
+
— Documentation by YARD 0.9.20
|
10
10
|
|
11
11
|
</title>
|
12
12
|
|
@@ -136,7 +136,7 @@
|
|
136
136
|
|
137
137
|
|
138
138
|
<h3 class="inherited">Methods inherited from <span class='object_link'><a href="Node.html" title="Schemacop::Node (class)">Node</a></span></h3>
|
139
|
-
<p class="inherited"><span class='object_link'><a href="Node.html#build-class_method" title="Schemacop::Node.build (method)">build</a></span>, <span class='object_link'><a href="Node.html#class_matches%3F-class_method" title="Schemacop::Node.class_matches? (method)">class_matches?</a></span>, <span class='object_link'><a href="Node.html#clear_klasses-class_method" title="Schemacop::Node.clear_klasses (method)">clear_klasses</a></span>, <span class='object_link'><a href="Node.html#clear_symbols-class_method" title="Schemacop::Node.clear_symbols (method)">clear_symbols</a></span>, <span class='object_link'><a href="Node.html#exec_block-instance_method" title="Schemacop::Node#exec_block (method)">#exec_block</a></span>, <span class='object_link'><a href="Node.html#initialize-instance_method" title="Schemacop::Node#initialize (method)">#initialize</a></span>, <span class='object_link'><a href="Node.html#klass-class_method" title="Schemacop::Node.klass (method)">klass</a></span>, <span class='object_link'><a href="Node.html#option-class_method" title="Schemacop::Node.option (method)">option</a></span>, <span class='object_link'><a href="Node.html#option-instance_method" title="Schemacop::Node#option (method)">#option</a></span>, <span class='object_link'><a href="Node.html#option%3F-instance_method" title="Schemacop::Node#option? (method)">#option?</a></span>, <span class='object_link'><a href="Node.html#register-class_method" title="Schemacop::Node.register (method)">register</a></span>, <span class='object_link'><a href="Node.html#resolve_type_klass-instance_method" title="Schemacop::Node#resolve_type_klass (method)">#resolve_type_klass</a></span>, <span class='object_link'><a href="Node.html#symbol-class_method" title="Schemacop::Node.symbol (method)">symbol</a></span>, <span class='object_link'><a href="Node.html#symbol_matches%3F-class_method" title="Schemacop::Node.symbol_matches? (method)">symbol_matches?</a></span>, <span class='object_link'><a href="Node.html#type_filter_matches%3F-instance_method" title="Schemacop::Node#type_filter_matches? (method)">#type_filter_matches?</a></span>, <span class='object_link'><a href="Node.html#type_label-instance_method" title="Schemacop::Node#type_label (method)">#type_label</a></span>, <span class='object_link'><a href="Node.html#type_matches%3F-
|
139
|
+
<p class="inherited"><span class='object_link'><a href="Node.html#build-class_method" title="Schemacop::Node.build (method)">build</a></span>, <span class='object_link'><a href="Node.html#class_matches%3F-class_method" title="Schemacop::Node.class_matches? (method)">class_matches?</a></span>, <span class='object_link'><a href="Node.html#clear_klasses-class_method" title="Schemacop::Node.clear_klasses (method)">clear_klasses</a></span>, <span class='object_link'><a href="Node.html#clear_symbols-class_method" title="Schemacop::Node.clear_symbols (method)">clear_symbols</a></span>, <span class='object_link'><a href="Node.html#exec_block-instance_method" title="Schemacop::Node#exec_block (method)">#exec_block</a></span>, <span class='object_link'><a href="Node.html#initialize-instance_method" title="Schemacop::Node#initialize (method)">#initialize</a></span>, <span class='object_link'><a href="Node.html#klass-class_method" title="Schemacop::Node.klass (method)">klass</a></span>, <span class='object_link'><a href="Node.html#option-class_method" title="Schemacop::Node.option (method)">option</a></span>, <span class='object_link'><a href="Node.html#option-instance_method" title="Schemacop::Node#option (method)">#option</a></span>, <span class='object_link'><a href="Node.html#option%3F-instance_method" title="Schemacop::Node#option? (method)">#option?</a></span>, <span class='object_link'><a href="Node.html#register-class_method" title="Schemacop::Node.register (method)">register</a></span>, <span class='object_link'><a href="Node.html#resolve_type_klass-instance_method" title="Schemacop::Node#resolve_type_klass (method)">#resolve_type_klass</a></span>, <span class='object_link'><a href="Node.html#symbol-class_method" title="Schemacop::Node.symbol (method)">symbol</a></span>, <span class='object_link'><a href="Node.html#symbol_matches%3F-class_method" title="Schemacop::Node.symbol_matches? (method)">symbol_matches?</a></span>, <span class='object_link'><a href="Node.html#type_filter_matches%3F-instance_method" title="Schemacop::Node#type_filter_matches? (method)">#type_filter_matches?</a></span>, <span class='object_link'><a href="Node.html#type_label-instance_method" title="Schemacop::Node#type_label (method)">#type_label</a></span>, <span class='object_link'><a href="Node.html#type_matches%3F-instance_method" title="Schemacop::Node#type_matches? (method)">#type_matches?</a></span>, <span class='object_link'><a href="Node.html#type_matches%3F-class_method" title="Schemacop::Node.type_matches? (method)">type_matches?</a></span>, <span class='object_link'><a href="Node.html#validate-instance_method" title="Schemacop::Node#validate (method)">#validate</a></span></p>
|
140
140
|
<div id="constructor_details" class="method_details_list">
|
141
141
|
<h2>Constructor Details</h2>
|
142
142
|
|
@@ -148,9 +148,9 @@
|
|
148
148
|
</div>
|
149
149
|
|
150
150
|
<div id="footer">
|
151
|
-
Generated on
|
151
|
+
Generated on Mon Oct 28 16:22:00 2019 by
|
152
152
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
153
|
-
0.9.
|
153
|
+
0.9.20 (ruby-2.6.2).
|
154
154
|
</div>
|
155
155
|
|
156
156
|
</div>
|
@@ -6,7 +6,7 @@
|
|
6
6
|
<title>
|
7
7
|
Class: Schemacop::NilValidator
|
8
8
|
|
9
|
-
— Documentation by YARD 0.9.
|
9
|
+
— Documentation by YARD 0.9.20
|
10
10
|
|
11
11
|
</title>
|
12
12
|
|
@@ -123,7 +123,7 @@
|
|
123
123
|
<h2>Method Summary</h2>
|
124
124
|
|
125
125
|
<h3 class="inherited">Methods inherited from <span class='object_link'><a href="Node.html" title="Schemacop::Node (class)">Node</a></span></h3>
|
126
|
-
<p class="inherited"><span class='object_link'><a href="Node.html#build-class_method" title="Schemacop::Node.build (method)">build</a></span>, <span class='object_link'><a href="Node.html#class_matches%3F-class_method" title="Schemacop::Node.class_matches? (method)">class_matches?</a></span>, <span class='object_link'><a href="Node.html#clear_klasses-class_method" title="Schemacop::Node.clear_klasses (method)">clear_klasses</a></span>, <span class='object_link'><a href="Node.html#clear_symbols-class_method" title="Schemacop::Node.clear_symbols (method)">clear_symbols</a></span>, <span class='object_link'><a href="Node.html#exec_block-instance_method" title="Schemacop::Node#exec_block (method)">#exec_block</a></span>, <span class='object_link'><a href="Node.html#initialize-instance_method" title="Schemacop::Node#initialize (method)">#initialize</a></span>, <span class='object_link'><a href="Node.html#klass-class_method" title="Schemacop::Node.klass (method)">klass</a></span>, <span class='object_link'><a href="Node.html#option-class_method" title="Schemacop::Node.option (method)">option</a></span>, <span class='object_link'><a href="Node.html#option-instance_method" title="Schemacop::Node#option (method)">#option</a></span>, <span class='object_link'><a href="Node.html#option%3F-instance_method" title="Schemacop::Node#option? (method)">#option?</a></span>, <span class='object_link'><a href="Node.html#register-class_method" title="Schemacop::Node.register (method)">register</a></span>, <span class='object_link'><a href="Node.html#resolve_type_klass-instance_method" title="Schemacop::Node#resolve_type_klass (method)">#resolve_type_klass</a></span>, <span class='object_link'><a href="Node.html#symbol-class_method" title="Schemacop::Node.symbol (method)">symbol</a></span>, <span class='object_link'><a href="Node.html#symbol_matches%3F-class_method" title="Schemacop::Node.symbol_matches? (method)">symbol_matches?</a></span>, <span class='object_link'><a href="Node.html#type_filter_matches%3F-instance_method" title="Schemacop::Node#type_filter_matches? (method)">#type_filter_matches?</a></span>, <span class='object_link'><a href="Node.html#type_label-instance_method" title="Schemacop::Node#type_label (method)">#type_label</a></span>, <span class='object_link'><a href="Node.html#type_matches%3F-
|
126
|
+
<p class="inherited"><span class='object_link'><a href="Node.html#build-class_method" title="Schemacop::Node.build (method)">build</a></span>, <span class='object_link'><a href="Node.html#class_matches%3F-class_method" title="Schemacop::Node.class_matches? (method)">class_matches?</a></span>, <span class='object_link'><a href="Node.html#clear_klasses-class_method" title="Schemacop::Node.clear_klasses (method)">clear_klasses</a></span>, <span class='object_link'><a href="Node.html#clear_symbols-class_method" title="Schemacop::Node.clear_symbols (method)">clear_symbols</a></span>, <span class='object_link'><a href="Node.html#exec_block-instance_method" title="Schemacop::Node#exec_block (method)">#exec_block</a></span>, <span class='object_link'><a href="Node.html#initialize-instance_method" title="Schemacop::Node#initialize (method)">#initialize</a></span>, <span class='object_link'><a href="Node.html#klass-class_method" title="Schemacop::Node.klass (method)">klass</a></span>, <span class='object_link'><a href="Node.html#option-class_method" title="Schemacop::Node.option (method)">option</a></span>, <span class='object_link'><a href="Node.html#option-instance_method" title="Schemacop::Node#option (method)">#option</a></span>, <span class='object_link'><a href="Node.html#option%3F-instance_method" title="Schemacop::Node#option? (method)">#option?</a></span>, <span class='object_link'><a href="Node.html#register-class_method" title="Schemacop::Node.register (method)">register</a></span>, <span class='object_link'><a href="Node.html#resolve_type_klass-instance_method" title="Schemacop::Node#resolve_type_klass (method)">#resolve_type_klass</a></span>, <span class='object_link'><a href="Node.html#symbol-class_method" title="Schemacop::Node.symbol (method)">symbol</a></span>, <span class='object_link'><a href="Node.html#symbol_matches%3F-class_method" title="Schemacop::Node.symbol_matches? (method)">symbol_matches?</a></span>, <span class='object_link'><a href="Node.html#type_filter_matches%3F-instance_method" title="Schemacop::Node#type_filter_matches? (method)">#type_filter_matches?</a></span>, <span class='object_link'><a href="Node.html#type_label-instance_method" title="Schemacop::Node#type_label (method)">#type_label</a></span>, <span class='object_link'><a href="Node.html#type_matches%3F-instance_method" title="Schemacop::Node#type_matches? (method)">#type_matches?</a></span>, <span class='object_link'><a href="Node.html#type_matches%3F-class_method" title="Schemacop::Node.type_matches? (method)">type_matches?</a></span>, <span class='object_link'><a href="Node.html#validate-instance_method" title="Schemacop::Node#validate (method)">#validate</a></span></p>
|
127
127
|
<div id="constructor_details" class="method_details_list">
|
128
128
|
<h2>Constructor Details</h2>
|
129
129
|
|
@@ -135,9 +135,9 @@
|
|
135
135
|
</div>
|
136
136
|
|
137
137
|
<div id="footer">
|
138
|
-
Generated on
|
138
|
+
Generated on Mon Oct 28 16:21:59 2019 by
|
139
139
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
140
|
-
0.9.
|
140
|
+
0.9.20 (ruby-2.6.2).
|
141
141
|
</div>
|
142
142
|
|
143
143
|
</div>
|
data/doc/Schemacop/Node.html
CHANGED
@@ -6,7 +6,7 @@
|
|
6
6
|
<title>
|
7
7
|
Class: Schemacop::Node
|
8
8
|
|
9
|
-
— Documentation by YARD 0.9.
|
9
|
+
— Documentation by YARD 0.9.20
|
10
10
|
|
11
11
|
</title>
|
12
12
|
|
@@ -286,7 +286,7 @@
|
|
286
286
|
<li class="public ">
|
287
287
|
<span class="summary_signature">
|
288
288
|
|
289
|
-
<a href="#register-class_method" title="register (class method)">.<strong>register</strong>(symbols: [], klasses: [], clear: true) ⇒ Object </a>
|
289
|
+
<a href="#register-class_method" title="register (class method)">.<strong>register</strong>(symbols: [], klasses: [], clear: true, before: nil) ⇒ Object </a>
|
290
290
|
|
291
291
|
|
292
292
|
|
@@ -612,17 +612,23 @@
|
|
612
612
|
<pre class="lines">
|
613
613
|
|
614
614
|
|
615
|
-
76
|
616
|
-
77
|
617
615
|
78
|
618
616
|
79
|
619
617
|
80
|
620
618
|
81
|
621
619
|
82
|
622
|
-
83
|
620
|
+
83
|
621
|
+
84
|
622
|
+
85
|
623
|
+
86
|
624
|
+
87
|
625
|
+
88
|
626
|
+
89
|
627
|
+
90
|
628
|
+
91</pre>
|
623
629
|
</td>
|
624
630
|
<td>
|
625
|
-
<pre class="code"><span class="info file"># File 'lib/schemacop/node.rb', line
|
631
|
+
<pre class="code"><span class="info file"># File 'lib/schemacop/node.rb', line 78</span>
|
626
632
|
|
627
633
|
<span class='kw'>def</span> <span class='id identifier rubyid_initialize'>initialize</span><span class='lparen'>(</span><span class='id identifier rubyid_options'>options</span> <span class='op'>=</span> <span class='lbrace'>{</span><span class='rbrace'>}</span><span class='rparen'>)</span>
|
628
634
|
<span class='comment'># Check and save given options
|
@@ -631,6 +637,12 @@
|
|
631
637
|
<span class='id identifier rubyid_fail'>fail</span> <span class='const'><span class='object_link'><a href="Exceptions.html" title="Schemacop::Exceptions (module)">Exceptions</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="Exceptions/InvalidSchemaError.html" title="Schemacop::Exceptions::InvalidSchemaError (class)">InvalidSchemaError</a></span></span><span class='comma'>,</span>
|
632
638
|
<span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>Unrecognized option(s) </span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_obsolete_opts'>obsolete_opts</span><span class='period'>.</span><span class='id identifier rubyid_inspect'>inspect</span><span class='embexpr_end'>}</span><span class='tstring_content'> for </span><span class='embexpr_beg'>#{</span><span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_class'>class</span><span class='period'>.</span><span class='id identifier rubyid_inspect'>inspect</span><span class='embexpr_end'>}</span><span class='tstring_content'>, allowed options: </span><span class='embexpr_beg'>#{</span><span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_class'>class</span><span class='period'>.</span><span class='id identifier rubyid_allowed_options'>allowed_options</span><span class='period'>.</span><span class='id identifier rubyid_keys'>keys</span><span class='period'>.</span><span class='id identifier rubyid_inspect'>inspect</span><span class='embexpr_end'>}</span><span class='tstring_content'>.</span><span class='tstring_end'>"</span></span>
|
633
639
|
<span class='kw'>end</span>
|
640
|
+
|
641
|
+
<span class='kw'>if</span> <span class='id identifier rubyid_option?'>option?</span><span class='lparen'>(</span><span class='symbol'>:cast</span><span class='rparen'>)</span> <span class='op'>&&</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_class'>class</span><span class='period'>.</span><span class='id identifier rubyid_klasses'>klasses</span><span class='period'>.</span><span class='id identifier rubyid_size'>size</span> <span class='op'>></span> <span class='int'>1</span>
|
642
|
+
<span class='id identifier rubyid_fail'>fail</span> <span class='const'><span class='object_link'><a href="Exceptions.html" title="Schemacop::Exceptions (module)">Exceptions</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="Exceptions/InvalidSchemaError.html" title="Schemacop::Exceptions::InvalidSchemaError (class)">InvalidSchemaError</a></span></span><span class='comma'>,</span>
|
643
|
+
<span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>Casting is only allowed for single-value datatypes, but type </span><span class='embexpr_beg'>#{</span><span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_class'>class</span><span class='period'>.</span><span class='id identifier rubyid_inspect'>inspect</span><span class='embexpr_end'>}</span><span class='tstring_content'> has classes </span><span class='tstring_end'>"</span></span>\
|
644
|
+
<span class='tstring'><span class='tstring_beg'>"</span><span class='embexpr_beg'>#{</span><span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_class'>class</span><span class='period'>.</span><span class='id identifier rubyid_klasses'>klasses</span><span class='period'>.</span><span class='id identifier rubyid_map'>map</span><span class='lparen'>(</span><span class='op'>&</span><span class='symbol'>:inspect</span><span class='rparen'>)</span><span class='embexpr_end'>}</span><span class='tstring_content'>.</span><span class='tstring_end'>"</span></span>
|
645
|
+
<span class='kw'>end</span>
|
634
646
|
<span class='kw'>end</span></pre>
|
635
647
|
</td>
|
636
648
|
</tr>
|
@@ -706,12 +718,12 @@
|
|
706
718
|
<pre class="lines">
|
707
719
|
|
708
720
|
|
709
|
-
|
710
|
-
|
711
|
-
|
721
|
+
74
|
722
|
+
75
|
723
|
+
76</pre>
|
712
724
|
</td>
|
713
725
|
<td>
|
714
|
-
<pre class="code"><span class="info file"># File 'lib/schemacop/node.rb', line
|
726
|
+
<pre class="code"><span class="info file"># File 'lib/schemacop/node.rb', line 74</span>
|
715
727
|
|
716
728
|
<span class='kw'>def</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_build'>build</span><span class='lparen'>(</span><span class='id identifier rubyid_options'>options</span><span class='comma'>,</span> <span class='op'>&</span><span class='id identifier rubyid_block'>block</span><span class='rparen'>)</span>
|
717
729
|
<span class='id identifier rubyid_new'>new</span><span class='lparen'>(</span><span class='id identifier rubyid_options'>options</span><span class='comma'>,</span> <span class='op'>&</span><span class='id identifier rubyid_block'>block</span><span class='rparen'>)</span>
|
@@ -758,16 +770,16 @@
|
|
758
770
|
<pre class="lines">
|
759
771
|
|
760
772
|
|
761
|
-
64
|
762
|
-
65
|
763
773
|
66
|
764
774
|
67
|
765
775
|
68
|
766
776
|
69
|
767
|
-
70
|
777
|
+
70
|
778
|
+
71
|
779
|
+
72</pre>
|
768
780
|
</td>
|
769
781
|
<td>
|
770
|
-
<pre class="code"><span class="info file"># File 'lib/schemacop/node.rb', line
|
782
|
+
<pre class="code"><span class="info file"># File 'lib/schemacop/node.rb', line 66</span>
|
771
783
|
|
772
784
|
<span class='kw'>def</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_class_matches?'>class_matches?</span><span class='lparen'>(</span><span class='id identifier rubyid_type'>type</span><span class='rparen'>)</span>
|
773
785
|
<span class='kw'>return</span> <span class='kw'>false</span> <span class='kw'>unless</span> <span class='id identifier rubyid_type'>type</span><span class='period'>.</span><span class='id identifier rubyid_is_a?'>is_a?</span><span class='lparen'>(</span><span class='const'>Class</span><span class='rparen'>)</span>
|
@@ -796,12 +808,12 @@
|
|
796
808
|
<pre class="lines">
|
797
809
|
|
798
810
|
|
799
|
-
|
800
|
-
|
801
|
-
|
811
|
+
41
|
812
|
+
42
|
813
|
+
43</pre>
|
802
814
|
</td>
|
803
815
|
<td>
|
804
|
-
<pre class="code"><span class="info file"># File 'lib/schemacop/node.rb', line
|
816
|
+
<pre class="code"><span class="info file"># File 'lib/schemacop/node.rb', line 41</span>
|
805
817
|
|
806
818
|
<span class='kw'>def</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_clear_klasses'>clear_klasses</span>
|
807
819
|
<span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_klasses'>klasses</span> <span class='op'>=</span> <span class='lbracket'>[</span><span class='rbracket'>]</span><span class='period'>.</span><span class='id identifier rubyid_freeze'>freeze</span>
|
@@ -826,12 +838,12 @@
|
|
826
838
|
<pre class="lines">
|
827
839
|
|
828
840
|
|
829
|
-
|
830
|
-
|
831
|
-
|
841
|
+
33
|
842
|
+
34
|
843
|
+
35</pre>
|
832
844
|
</td>
|
833
845
|
<td>
|
834
|
-
<pre class="code"><span class="info file"># File 'lib/schemacop/node.rb', line
|
846
|
+
<pre class="code"><span class="info file"># File 'lib/schemacop/node.rb', line 33</span>
|
835
847
|
|
836
848
|
<span class='kw'>def</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_clear_symbols'>clear_symbols</span>
|
837
849
|
<span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_symbols'>symbols</span> <span class='op'>=</span> <span class='lbracket'>[</span><span class='rbracket'>]</span><span class='period'>.</span><span class='id identifier rubyid_freeze'>freeze</span>
|
@@ -856,12 +868,12 @@
|
|
856
868
|
<pre class="lines">
|
857
869
|
|
858
870
|
|
859
|
-
|
860
|
-
|
861
|
-
|
871
|
+
37
|
872
|
+
38
|
873
|
+
39</pre>
|
862
874
|
</td>
|
863
875
|
<td>
|
864
|
-
<pre class="code"><span class="info file"># File 'lib/schemacop/node.rb', line
|
876
|
+
<pre class="code"><span class="info file"># File 'lib/schemacop/node.rb', line 37</span>
|
865
877
|
|
866
878
|
<span class='kw'>def</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_klass'>klass</span><span class='lparen'>(</span><span class='id identifier rubyid_klass'>klass</span><span class='rparen'>)</span>
|
867
879
|
<span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_klasses'>klasses</span> <span class='op'>+=</span> <span class='lbracket'>[</span><span class='id identifier rubyid_klass'>klass</span><span class='rbracket'>]</span>
|
@@ -904,7 +916,7 @@
|
|
904
916
|
<div class="method_details ">
|
905
917
|
<h3 class="signature " id="register-class_method">
|
906
918
|
|
907
|
-
.<strong>register</strong>(symbols: [], klasses: [], clear: true) ⇒ <tt>Object</tt>
|
919
|
+
.<strong>register</strong>(symbols: [], klasses: [], clear: true, before: nil) ⇒ <tt>Object</tt>
|
908
920
|
|
909
921
|
|
910
922
|
|
@@ -916,8 +928,6 @@
|
|
916
928
|
<pre class="lines">
|
917
929
|
|
918
930
|
|
919
|
-
43
|
920
|
-
44
|
921
931
|
45
|
922
932
|
46
|
923
933
|
47
|
@@ -926,13 +936,15 @@
|
|
926
936
|
50
|
927
937
|
51
|
928
938
|
52
|
929
|
-
53
|
939
|
+
53
|
940
|
+
54
|
941
|
+
55</pre>
|
930
942
|
</td>
|
931
943
|
<td>
|
932
|
-
<pre class="code"><span class="info file"># File 'lib/schemacop/node.rb', line
|
944
|
+
<pre class="code"><span class="info file"># File 'lib/schemacop/node.rb', line 45</span>
|
933
945
|
|
934
|
-
<span class='kw'>def</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_register'>register</span><span class='lparen'>(</span><span class='label'>symbols:</span> <span class='lbracket'>[</span><span class='rbracket'>]</span><span class='comma'>,</span> <span class='label'>klasses:</span> <span class='lbracket'>[</span><span class='rbracket'>]</span><span class='comma'>,</span> <span class='label'>clear:</span> <span class='kw'>true</span><span class='rparen'>)</span>
|
935
|
-
<span class='const'><span class='object_link'><a href="NodeResolver.html" title="Schemacop::NodeResolver (class)">NodeResolver</a></span></span><span class='period'>.</span><span class='id identifier rubyid_register'><span class='object_link'><a href="NodeResolver.html#register-class_method" title="Schemacop::NodeResolver.register (method)">register</a></span></span><span class='lparen'>(</span><span class='kw'>self</span><span class='rparen'>)</span>
|
946
|
+
<span class='kw'>def</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_register'>register</span><span class='lparen'>(</span><span class='label'>symbols:</span> <span class='lbracket'>[</span><span class='rbracket'>]</span><span class='comma'>,</span> <span class='label'>klasses:</span> <span class='lbracket'>[</span><span class='rbracket'>]</span><span class='comma'>,</span> <span class='label'>clear:</span> <span class='kw'>true</span><span class='comma'>,</span> <span class='label'>before:</span> <span class='kw'>nil</span><span class='rparen'>)</span>
|
947
|
+
<span class='const'><span class='object_link'><a href="NodeResolver.html" title="Schemacop::NodeResolver (class)">NodeResolver</a></span></span><span class='period'>.</span><span class='id identifier rubyid_register'><span class='object_link'><a href="NodeResolver.html#register-class_method" title="Schemacop::NodeResolver.register (method)">register</a></span></span><span class='lparen'>(</span><span class='kw'>self</span><span class='comma'>,</span> <span class='label'>before:</span> <span class='id identifier rubyid_before'>before</span><span class='rparen'>)</span>
|
936
948
|
<span class='id identifier rubyid_symbols'>symbols</span> <span class='op'>=</span> <span class='lbracket'>[</span><span class='op'>*</span><span class='id identifier rubyid_symbols'>symbols</span><span class='rbracket'>]</span>
|
937
949
|
<span class='id identifier rubyid_klasses'>klasses</span> <span class='op'>=</span> <span class='lbracket'>[</span><span class='op'>*</span><span class='id identifier rubyid_klasses'>klasses</span><span class='rbracket'>]</span>
|
938
950
|
<span class='kw'>if</span> <span class='id identifier rubyid_clear'>clear</span>
|
@@ -962,12 +974,12 @@
|
|
962
974
|
<pre class="lines">
|
963
975
|
|
964
976
|
|
965
|
-
|
966
|
-
|
967
|
-
|
977
|
+
29
|
978
|
+
30
|
979
|
+
31</pre>
|
968
980
|
</td>
|
969
981
|
<td>
|
970
|
-
<pre class="code"><span class="info file"># File 'lib/schemacop/node.rb', line
|
982
|
+
<pre class="code"><span class="info file"># File 'lib/schemacop/node.rb', line 29</span>
|
971
983
|
|
972
984
|
<span class='kw'>def</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_symbol'>symbol</span><span class='lparen'>(</span><span class='id identifier rubyid_symbol'>symbol</span><span class='rparen'>)</span>
|
973
985
|
<span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_symbols'>symbols</span> <span class='op'>+=</span> <span class='lbracket'>[</span><span class='id identifier rubyid_symbol'>symbol</span><span class='rbracket'>]</span>
|
@@ -1014,13 +1026,13 @@
|
|
1014
1026
|
<pre class="lines">
|
1015
1027
|
|
1016
1028
|
|
1017
|
-
59
|
1018
|
-
60
|
1019
1029
|
61
|
1020
|
-
62
|
1030
|
+
62
|
1031
|
+
63
|
1032
|
+
64</pre>
|
1021
1033
|
</td>
|
1022
1034
|
<td>
|
1023
|
-
<pre class="code"><span class="info file"># File 'lib/schemacop/node.rb', line
|
1035
|
+
<pre class="code"><span class="info file"># File 'lib/schemacop/node.rb', line 61</span>
|
1024
1036
|
|
1025
1037
|
<span class='kw'>def</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_symbol_matches?'>symbol_matches?</span><span class='lparen'>(</span><span class='id identifier rubyid_type'>type</span><span class='rparen'>)</span>
|
1026
1038
|
<span class='kw'>return</span> <span class='kw'>false</span> <span class='kw'>unless</span> <span class='id identifier rubyid_type'>type</span><span class='period'>.</span><span class='id identifier rubyid_is_a?'>is_a?</span><span class='lparen'>(</span><span class='const'>Symbol</span><span class='rparen'>)</span>
|
@@ -1068,12 +1080,12 @@
|
|
1068
1080
|
<pre class="lines">
|
1069
1081
|
|
1070
1082
|
|
1071
|
-
|
1072
|
-
|
1073
|
-
|
1083
|
+
57
|
1084
|
+
58
|
1085
|
+
59</pre>
|
1074
1086
|
</td>
|
1075
1087
|
<td>
|
1076
|
-
<pre class="code"><span class="info file"># File 'lib/schemacop/node.rb', line
|
1088
|
+
<pre class="code"><span class="info file"># File 'lib/schemacop/node.rb', line 57</span>
|
1077
1089
|
|
1078
1090
|
<span class='kw'>def</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_type_matches?'>type_matches?</span><span class='lparen'>(</span><span class='id identifier rubyid_type'>type</span><span class='rparen'>)</span>
|
1079
1091
|
<span class='id identifier rubyid_symbol_matches?'>symbol_matches?</span><span class='lparen'>(</span><span class='id identifier rubyid_type'>type</span><span class='rparen'>)</span> <span class='op'>||</span> <span class='id identifier rubyid_class_matches?'>class_matches?</span><span class='lparen'>(</span><span class='id identifier rubyid_type'>type</span><span class='rparen'>)</span>
|
@@ -1104,12 +1116,12 @@
|
|
1104
1116
|
<pre class="lines">
|
1105
1117
|
|
1106
1118
|
|
1107
|
-
|
1108
|
-
|
1109
|
-
|
1119
|
+
103
|
1120
|
+
104
|
1121
|
+
105</pre>
|
1110
1122
|
</td>
|
1111
1123
|
<td>
|
1112
|
-
<pre class="code"><span class="info file"># File 'lib/schemacop/node.rb', line
|
1124
|
+
<pre class="code"><span class="info file"># File 'lib/schemacop/node.rb', line 103</span>
|
1113
1125
|
|
1114
1126
|
<span class='kw'>def</span> <span class='id identifier rubyid_exec_block'>exec_block</span>
|
1115
1127
|
<span class='id identifier rubyid_fail'>fail</span> <span class='const'><span class='object_link'><a href="Exceptions.html" title="Schemacop::Exceptions (module)">Exceptions</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="Exceptions/InvalidSchemaError.html" title="Schemacop::Exceptions::InvalidSchemaError (class)">InvalidSchemaError</a></span></span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>Node does not support block.</span><span class='tstring_end'>'</span></span> <span class='kw'>if</span> <span class='id identifier rubyid_block_given?'>block_given?</span>
|
@@ -1134,12 +1146,12 @@
|
|
1134
1146
|
<pre class="lines">
|
1135
1147
|
|
1136
1148
|
|
1137
|
-
|
1138
|
-
|
1139
|
-
|
1149
|
+
93
|
1150
|
+
94
|
1151
|
+
95</pre>
|
1140
1152
|
</td>
|
1141
1153
|
<td>
|
1142
|
-
<pre class="code"><span class="info file"># File 'lib/schemacop/node.rb', line
|
1154
|
+
<pre class="code"><span class="info file"># File 'lib/schemacop/node.rb', line 93</span>
|
1143
1155
|
|
1144
1156
|
<span class='kw'>def</span> <span class='id identifier rubyid_option'>option</span><span class='lparen'>(</span><span class='id identifier rubyid_key'>key</span><span class='rparen'>)</span>
|
1145
1157
|
<span class='id identifier rubyid_options'>options</span><span class='lbracket'>[</span><span class='id identifier rubyid_key'>key</span><span class='rbracket'>]</span>
|
@@ -1186,14 +1198,14 @@
|
|
1186
1198
|
<pre class="lines">
|
1187
1199
|
|
1188
1200
|
|
1189
|
-
|
1190
|
-
|
1191
|
-
|
1192
|
-
|
1193
|
-
|
1201
|
+
97
|
1202
|
+
98
|
1203
|
+
99
|
1204
|
+
100
|
1205
|
+
101</pre>
|
1194
1206
|
</td>
|
1195
1207
|
<td>
|
1196
|
-
<pre class="code"><span class="info file"># File 'lib/schemacop/node.rb', line
|
1208
|
+
<pre class="code"><span class="info file"># File 'lib/schemacop/node.rb', line 97</span>
|
1197
1209
|
|
1198
1210
|
<span class='kw'>def</span> <span class='id identifier rubyid_option?'>option?</span><span class='lparen'>(</span><span class='id identifier rubyid_key'>key</span><span class='rparen'>)</span>
|
1199
1211
|
<span class='comment'># rubocop:disable Style/DoubleNegation
|
@@ -1220,16 +1232,16 @@
|
|
1220
1232
|
<pre class="lines">
|
1221
1233
|
|
1222
1234
|
|
1223
|
-
|
1224
|
-
|
1225
|
-
|
1226
|
-
|
1227
|
-
|
1228
|
-
|
1229
|
-
|
1235
|
+
107
|
1236
|
+
108
|
1237
|
+
109
|
1238
|
+
110
|
1239
|
+
111
|
1240
|
+
112
|
1241
|
+
113</pre>
|
1230
1242
|
</td>
|
1231
1243
|
<td>
|
1232
|
-
<pre class="code"><span class="info file"># File 'lib/schemacop/node.rb', line
|
1244
|
+
<pre class="code"><span class="info file"># File 'lib/schemacop/node.rb', line 107</span>
|
1233
1245
|
|
1234
1246
|
<span class='kw'>def</span> <span class='id identifier rubyid_resolve_type_klass'>resolve_type_klass</span><span class='lparen'>(</span><span class='id identifier rubyid_type'>type</span><span class='rparen'>)</span>
|
1235
1247
|
<span class='id identifier rubyid_klass'>klass</span> <span class='op'>=</span> <span class='const'><span class='object_link'><a href="NodeResolver.html" title="Schemacop::NodeResolver (class)">NodeResolver</a></span></span><span class='period'>.</span><span class='id identifier rubyid_resolve'><span class='object_link'><a href="NodeResolver.html#resolve-class_method" title="Schemacop::NodeResolver.resolve (method)">resolve</a></span></span><span class='lparen'>(</span><span class='id identifier rubyid_type'>type</span><span class='rparen'>)</span>
|
@@ -1280,12 +1292,12 @@
|
|
1280
1292
|
<pre class="lines">
|
1281
1293
|
|
1282
1294
|
|
1283
|
-
|
1284
|
-
|
1285
|
-
|
1295
|
+
123
|
1296
|
+
124
|
1297
|
+
125</pre>
|
1286
1298
|
</td>
|
1287
1299
|
<td>
|
1288
|
-
<pre class="code"><span class="info file"># File 'lib/schemacop/node.rb', line
|
1300
|
+
<pre class="code"><span class="info file"># File 'lib/schemacop/node.rb', line 123</span>
|
1289
1301
|
|
1290
1302
|
<span class='kw'>def</span> <span class='id identifier rubyid_type_filter_matches?'>type_filter_matches?</span><span class='lparen'>(</span><span class='id identifier rubyid_data'>data</span><span class='rparen'>)</span>
|
1291
1303
|
<span class='op'>!</span><span class='id identifier rubyid_option?'>option?</span><span class='lparen'>(</span><span class='symbol'>:if</span><span class='rparen'>)</span> <span class='op'>||</span> <span class='id identifier rubyid_option'>option</span><span class='lparen'>(</span><span class='symbol'>:if</span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_call'>call</span><span class='lparen'>(</span><span class='id identifier rubyid_data'>data</span><span class='rparen'>)</span>
|
@@ -1310,14 +1322,14 @@
|
|
1310
1322
|
<pre class="lines">
|
1311
1323
|
|
1312
1324
|
|
1313
|
-
21
|
1314
|
-
22
|
1315
1325
|
23
|
1316
1326
|
24
|
1317
|
-
25
|
1327
|
+
25
|
1328
|
+
26
|
1329
|
+
27</pre>
|
1318
1330
|
</td>
|
1319
1331
|
<td>
|
1320
|
-
<pre class="code"><span class="info file"># File 'lib/schemacop/node.rb', line
|
1332
|
+
<pre class="code"><span class="info file"># File 'lib/schemacop/node.rb', line 23</span>
|
1321
1333
|
|
1322
1334
|
<span class='kw'>def</span> <span class='id identifier rubyid_type_label'>type_label</span>
|
1323
1335
|
<span class='id identifier rubyid_str'>str</span> <span class='op'>=</span> <span class='lparen'>(</span><span class='id identifier rubyid_symbols'>symbols</span><span class='period'>.</span><span class='id identifier rubyid_first'>first</span> <span class='op'>||</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>unknown</span><span class='tstring_end'>'</span></span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_to_s'>to_s</span>
|
@@ -1366,12 +1378,12 @@
|
|
1366
1378
|
<pre class="lines">
|
1367
1379
|
|
1368
1380
|
|
1369
|
-
|
1370
|
-
|
1371
|
-
|
1381
|
+
119
|
1382
|
+
120
|
1383
|
+
121</pre>
|
1372
1384
|
</td>
|
1373
1385
|
<td>
|
1374
|
-
<pre class="code"><span class="info file"># File 'lib/schemacop/node.rb', line
|
1386
|
+
<pre class="code"><span class="info file"># File 'lib/schemacop/node.rb', line 119</span>
|
1375
1387
|
|
1376
1388
|
<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>
|
1377
1389
|
<span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_class'>class</span><span class='period'>.</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='period'>.</span><span class='id identifier rubyid_class'>class</span><span class='rparen'>)</span> <span class='op'>&&</span> <span class='id identifier rubyid_type_filter_matches?'>type_filter_matches?</span><span class='lparen'>(</span><span class='id identifier rubyid_data'>data</span><span class='rparen'>)</span>
|
@@ -1396,12 +1408,12 @@
|
|
1396
1408
|
<pre class="lines">
|
1397
1409
|
|
1398
1410
|
|
1399
|
-
|
1400
|
-
|
1401
|
-
|
1411
|
+
115
|
1412
|
+
116
|
1413
|
+
117</pre>
|
1402
1414
|
</td>
|
1403
1415
|
<td>
|
1404
|
-
<pre class="code"><span class="info file"># File 'lib/schemacop/node.rb', line
|
1416
|
+
<pre class="code"><span class="info file"># File 'lib/schemacop/node.rb', line 115</span>
|
1405
1417
|
|
1406
1418
|
<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='comma'>,</span> <span class='id identifier rubyid_collector'>collector</span><span class='rparen'>)</span>
|
1407
1419
|
<span class='id identifier rubyid_validate_custom_check'>validate_custom_check</span><span class='lparen'>(</span><span class='id identifier rubyid_data'>data</span><span class='comma'>,</span> <span class='id identifier rubyid_collector'>collector</span><span class='rparen'>)</span>
|
@@ -1416,9 +1428,9 @@
|
|
1416
1428
|
</div>
|
1417
1429
|
|
1418
1430
|
<div id="footer">
|
1419
|
-
Generated on
|
1431
|
+
Generated on Mon Oct 28 16:21:59 2019 by
|
1420
1432
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
1421
|
-
0.9.
|
1433
|
+
0.9.20 (ruby-2.6.2).
|
1422
1434
|
</div>
|
1423
1435
|
|
1424
1436
|
</div>
|