schemacop 1.0.2 → 2.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (90) hide show
  1. checksums.yaml +4 -4
  2. data/.gitignore +2 -1
  3. data/.rubocop.yml +59 -1
  4. data/CHANGELOG.md +10 -0
  5. data/README.md +389 -199
  6. data/Rakefile +2 -0
  7. data/VERSION +1 -1
  8. data/doc/Schemacop.html +41 -130
  9. data/doc/Schemacop/ArrayValidator.html +329 -0
  10. data/doc/Schemacop/BooleanValidator.html +145 -0
  11. data/doc/Schemacop/Collector.html +535 -0
  12. data/doc/Schemacop/Exceptions.html +39 -39
  13. data/doc/Schemacop/Exceptions/InvalidSchemaError.html +124 -0
  14. data/doc/Schemacop/Exceptions/ValidationError.html +124 -0
  15. data/doc/Schemacop/FieldNode.html +409 -0
  16. data/doc/Schemacop/FloatValidator.html +158 -0
  17. data/doc/Schemacop/HashValidator.html +263 -0
  18. data/doc/Schemacop/IntegerValidator.html +158 -0
  19. data/doc/Schemacop/NilValidator.html +145 -0
  20. data/doc/Schemacop/Node.html +1426 -0
  21. data/doc/Schemacop/NodeResolver.html +242 -0
  22. data/doc/Schemacop/NodeSupportingField.html +590 -0
  23. data/doc/Schemacop/NodeSupportingType.html +614 -0
  24. data/doc/Schemacop/NodeWithBlock.html +289 -0
  25. data/doc/Schemacop/NumberValidator.html +232 -0
  26. data/doc/Schemacop/ObjectValidator.html +288 -0
  27. data/doc/Schemacop/RootNode.html +171 -0
  28. data/doc/Schemacop/Schema.html +697 -0
  29. data/doc/Schemacop/StringValidator.html +295 -0
  30. data/doc/ScopedEnv.html +351 -0
  31. data/doc/_index.html +190 -47
  32. data/doc/class_list.html +24 -31
  33. data/doc/css/full_list.css +32 -31
  34. data/doc/css/style.css +244 -91
  35. data/doc/file.README.html +428 -232
  36. data/doc/file_list.html +26 -30
  37. data/doc/frames.html +7 -16
  38. data/doc/index.html +428 -232
  39. data/doc/inheritance.graphml +524 -0
  40. data/doc/inheritance.pdf +825 -0
  41. data/doc/js/app.js +106 -77
  42. data/doc/js/full_list.js +170 -135
  43. data/doc/method_list.html +494 -38
  44. data/doc/top-level-namespace.html +36 -36
  45. data/lib/schemacop.rb +22 -7
  46. data/lib/schemacop/collector.rb +34 -0
  47. data/lib/schemacop/exceptions.rb +2 -8
  48. data/lib/schemacop/field_node.rb +26 -0
  49. data/lib/schemacop/node.rb +127 -0
  50. data/lib/schemacop/node_resolver.rb +14 -0
  51. data/lib/schemacop/node_supporting_field.rb +62 -0
  52. data/lib/schemacop/node_supporting_type.rb +112 -0
  53. data/lib/schemacop/node_with_block.rb +16 -0
  54. data/lib/schemacop/root_node.rb +4 -0
  55. data/lib/schemacop/schema.rb +61 -0
  56. data/lib/schemacop/scoped_env.rb +18 -0
  57. data/lib/schemacop/validator/array_validator.rb +30 -0
  58. data/lib/schemacop/validator/boolean_validator.rb +5 -0
  59. data/lib/schemacop/validator/float_validator.rb +5 -0
  60. data/lib/schemacop/validator/hash_validator.rb +18 -0
  61. data/lib/schemacop/validator/integer_validator.rb +5 -0
  62. data/lib/schemacop/validator/nil_validator.rb +5 -0
  63. data/lib/schemacop/validator/number_validator.rb +19 -0
  64. data/lib/schemacop/validator/object_validator.rb +21 -0
  65. data/lib/schemacop/validator/string_validator.rb +37 -0
  66. data/schemacop.gemspec +7 -5
  67. data/test/custom_check_test.rb +86 -0
  68. data/test/custom_if_test.rb +95 -0
  69. data/test/nil_dis_allow_test.rb +41 -0
  70. data/test/short_forms_test.rb +316 -0
  71. data/test/test_helper.rb +6 -0
  72. data/test/types_test.rb +83 -0
  73. data/test/validator_array_test.rb +97 -0
  74. data/test/validator_boolean_test.rb +15 -0
  75. data/test/validator_float_test.rb +57 -0
  76. data/test/validator_hash_test.rb +71 -0
  77. data/test/validator_integer_test.rb +46 -0
  78. data/test/validator_nil_test.rb +13 -0
  79. data/test/validator_number_test.rb +60 -0
  80. data/test/validator_object_test.rb +87 -0
  81. data/test/validator_string_test.rb +76 -0
  82. metadata +78 -14
  83. data/doc/Schemacop/Exceptions/Base.html +0 -127
  84. data/doc/Schemacop/Exceptions/InvalidSchema.html +0 -141
  85. data/doc/Schemacop/Exceptions/Validation.html +0 -142
  86. data/doc/Schemacop/MethodValidation.html +0 -120
  87. data/doc/Schemacop/MethodValidation/ClassMethods.html +0 -196
  88. data/doc/Schemacop/Validator.html +0 -254
  89. data/lib/schemacop/validator.rb +0 -145
  90. data/test/schemacop_validator_test.rb +0 -257
@@ -0,0 +1,145 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+ <meta charset="utf-8">
5
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
6
+ <title>
7
+ Class: Schemacop::NilValidator
8
+
9
+ &mdash; Documentation by YARD 0.9.9
10
+
11
+ </title>
12
+
13
+ <link rel="stylesheet" href="../css/style.css" type="text/css" charset="utf-8" />
14
+
15
+ <link rel="stylesheet" href="../css/common.css" type="text/css" charset="utf-8" />
16
+
17
+ <script type="text/javascript" charset="utf-8">
18
+ pathId = "Schemacop::NilValidator";
19
+ relpath = '../';
20
+ </script>
21
+
22
+
23
+ <script type="text/javascript" charset="utf-8" src="../js/jquery.js"></script>
24
+
25
+ <script type="text/javascript" charset="utf-8" src="../js/app.js"></script>
26
+
27
+
28
+ </head>
29
+ <body>
30
+ <div class="nav_wrap">
31
+ <iframe id="nav" src="../class_list.html?1"></iframe>
32
+ <div id="resizer"></div>
33
+ </div>
34
+
35
+ <div id="main" tabindex="-1">
36
+ <div id="header">
37
+ <div id="menu">
38
+
39
+ <a href="../_index.html">Index (N)</a> &raquo;
40
+ <span class='title'><span class='object_link'><a href="../Schemacop.html" title="Schemacop (module)">Schemacop</a></span></span>
41
+ &raquo;
42
+ <span class="title">NilValidator</span>
43
+
44
+ </div>
45
+
46
+ <div id="search">
47
+
48
+ <a class="full_list_link" id="class_list_link"
49
+ href="../class_list.html">
50
+
51
+ <svg width="24" height="24">
52
+ <rect x="0" y="4" width="24" height="4" rx="1" ry="1"></rect>
53
+ <rect x="0" y="12" width="24" height="4" rx="1" ry="1"></rect>
54
+ <rect x="0" y="20" width="24" height="4" rx="1" ry="1"></rect>
55
+ </svg>
56
+ </a>
57
+
58
+ </div>
59
+ <div class="clear"></div>
60
+ </div>
61
+
62
+ <div id="content"><h1>Class: Schemacop::NilValidator
63
+
64
+
65
+
66
+ </h1>
67
+ <div class="box_info">
68
+
69
+ <dl>
70
+ <dt>Inherits:</dt>
71
+ <dd>
72
+ <span class="inheritName"><span class='object_link'><a href="Node.html" title="Schemacop::Node (class)">Node</a></span></span>
73
+
74
+ <ul class="fullTree">
75
+ <li>Object</li>
76
+
77
+ <li class="next"><span class='object_link'><a href="Node.html" title="Schemacop::Node (class)">Node</a></span></li>
78
+
79
+ <li class="next">Schemacop::NilValidator</li>
80
+
81
+ </ul>
82
+ <a href="#" class="inheritanceTree">show all</a>
83
+
84
+ </dd>
85
+ </dl>
86
+
87
+
88
+
89
+
90
+
91
+
92
+
93
+
94
+
95
+
96
+
97
+ <dl>
98
+ <dt>Defined in:</dt>
99
+ <dd>lib/schemacop/validator/nil_validator.rb</dd>
100
+ </dl>
101
+
102
+ </div>
103
+
104
+
105
+
106
+
107
+
108
+
109
+
110
+ <h2>Instance Attribute Summary</h2>
111
+
112
+ <h3 class="inherited">Attributes inherited from <span class='object_link'><a href="Node.html" title="Schemacop::Node (class)">Node</a></span></h3>
113
+ <p class="inherited"><span class='object_link'><a href="Node.html#options-instance_method" title="Schemacop::Node#options (method)">#options</a></span></p>
114
+
115
+
116
+
117
+
118
+
119
+
120
+
121
+
122
+
123
+ <h2>Method Summary</h2>
124
+
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-class_method" title="Schemacop::Node.type_matches? (method)">type_matches?</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#validate-instance_method" title="Schemacop::Node#validate (method)">#validate</a></span></p>
127
+ <div id="constructor_details" class="method_details_list">
128
+ <h2>Constructor Details</h2>
129
+
130
+ <p class="notice">This class inherits a constructor from <span class='object_link'><a href="Node.html#initialize-instance_method" title="Schemacop::Node#initialize (method)">Schemacop::Node</a></span></p>
131
+
132
+ </div>
133
+
134
+
135
+ </div>
136
+
137
+ <div id="footer">
138
+ Generated on Mon May 15 17:46:05 2017 by
139
+ <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
140
+ 0.9.9 (ruby-2.3.1).
141
+ </div>
142
+
143
+ </div>
144
+ </body>
145
+ </html>
@@ -0,0 +1,1426 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+ <meta charset="utf-8">
5
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
6
+ <title>
7
+ Class: Schemacop::Node
8
+
9
+ &mdash; Documentation by YARD 0.9.9
10
+
11
+ </title>
12
+
13
+ <link rel="stylesheet" href="../css/style.css" type="text/css" charset="utf-8" />
14
+
15
+ <link rel="stylesheet" href="../css/common.css" type="text/css" charset="utf-8" />
16
+
17
+ <script type="text/javascript" charset="utf-8">
18
+ pathId = "Schemacop::Node";
19
+ relpath = '../';
20
+ </script>
21
+
22
+
23
+ <script type="text/javascript" charset="utf-8" src="../js/jquery.js"></script>
24
+
25
+ <script type="text/javascript" charset="utf-8" src="../js/app.js"></script>
26
+
27
+
28
+ </head>
29
+ <body>
30
+ <div class="nav_wrap">
31
+ <iframe id="nav" src="../class_list.html?1"></iframe>
32
+ <div id="resizer"></div>
33
+ </div>
34
+
35
+ <div id="main" tabindex="-1">
36
+ <div id="header">
37
+ <div id="menu">
38
+
39
+ <a href="../_index.html">Index (N)</a> &raquo;
40
+ <span class='title'><span class='object_link'><a href="../Schemacop.html" title="Schemacop (module)">Schemacop</a></span></span>
41
+ &raquo;
42
+ <span class="title">Node</span>
43
+
44
+ </div>
45
+
46
+ <div id="search">
47
+
48
+ <a class="full_list_link" id="class_list_link"
49
+ href="../class_list.html">
50
+
51
+ <svg width="24" height="24">
52
+ <rect x="0" y="4" width="24" height="4" rx="1" ry="1"></rect>
53
+ <rect x="0" y="12" width="24" height="4" rx="1" ry="1"></rect>
54
+ <rect x="0" y="20" width="24" height="4" rx="1" ry="1"></rect>
55
+ </svg>
56
+ </a>
57
+
58
+ </div>
59
+ <div class="clear"></div>
60
+ </div>
61
+
62
+ <div id="content"><h1>Class: Schemacop::Node
63
+
64
+
65
+
66
+ </h1>
67
+ <div class="box_info">
68
+
69
+ <dl>
70
+ <dt>Inherits:</dt>
71
+ <dd>
72
+ <span class="inheritName">Object</span>
73
+
74
+ <ul class="fullTree">
75
+ <li>Object</li>
76
+
77
+ <li class="next">Schemacop::Node</li>
78
+
79
+ </ul>
80
+ <a href="#" class="inheritanceTree">show all</a>
81
+
82
+ </dd>
83
+ </dl>
84
+
85
+
86
+
87
+
88
+
89
+
90
+
91
+
92
+
93
+
94
+
95
+ <dl>
96
+ <dt>Defined in:</dt>
97
+ <dd>lib/schemacop/node.rb</dd>
98
+ </dl>
99
+
100
+ </div>
101
+
102
+ <div id="subclasses">
103
+ <h2>Direct Known Subclasses</h2>
104
+ <p class="children"><span class='object_link'><a href="BooleanValidator.html" title="Schemacop::BooleanValidator (class)">BooleanValidator</a></span>, <span class='object_link'><a href="NilValidator.html" title="Schemacop::NilValidator (class)">NilValidator</a></span>, <span class='object_link'><a href="NodeWithBlock.html" title="Schemacop::NodeWithBlock (class)">NodeWithBlock</a></span>, <span class='object_link'><a href="NumberValidator.html" title="Schemacop::NumberValidator (class)">NumberValidator</a></span>, <span class='object_link'><a href="ObjectValidator.html" title="Schemacop::ObjectValidator (class)">ObjectValidator</a></span>, <span class='object_link'><a href="StringValidator.html" title="Schemacop::StringValidator (class)">StringValidator</a></span></p>
105
+ </div>
106
+
107
+
108
+
109
+
110
+ <h2>Instance Attribute Summary <small><a href="#" class="summary_toggle">collapse</a></small></h2>
111
+ <ul class="summary">
112
+
113
+ <li class="public ">
114
+ <span class="summary_signature">
115
+
116
+ <a href="#options-instance_method" title="#options (instance method)">#<strong>options</strong> &#x21d2; Object </a>
117
+
118
+
119
+
120
+ </span>
121
+
122
+
123
+
124
+
125
+ <span class="note title readonly">readonly</span>
126
+
127
+
128
+
129
+
130
+
131
+
132
+
133
+
134
+
135
+ <span class="summary_desc"><div class='inline'><p>Returns the value of attribute options.</p>
136
+ </div></span>
137
+
138
+ </li>
139
+
140
+
141
+ </ul>
142
+
143
+
144
+
145
+
146
+
147
+ <h2>
148
+ Class Method Summary
149
+ <small><a href="#" class="summary_toggle">collapse</a></small>
150
+ </h2>
151
+
152
+ <ul class="summary">
153
+
154
+ <li class="public ">
155
+ <span class="summary_signature">
156
+
157
+ <a href="#build-class_method" title="build (class method)">.<strong>build</strong>(options, &amp;block) &#x21d2; Object </a>
158
+
159
+
160
+
161
+ </span>
162
+
163
+
164
+
165
+
166
+
167
+
168
+
169
+
170
+
171
+ <span class="summary_desc"><div class='inline'></div></span>
172
+
173
+ </li>
174
+
175
+
176
+ <li class="public ">
177
+ <span class="summary_signature">
178
+
179
+ <a href="#class_matches%3F-class_method" title="class_matches? (class method)">.<strong>class_matches?</strong>(type) &#x21d2; Boolean </a>
180
+
181
+
182
+
183
+ </span>
184
+
185
+
186
+
187
+
188
+
189
+
190
+
191
+
192
+
193
+ <span class="summary_desc"><div class='inline'></div></span>
194
+
195
+ </li>
196
+
197
+
198
+ <li class="public ">
199
+ <span class="summary_signature">
200
+
201
+ <a href="#clear_klasses-class_method" title="clear_klasses (class method)">.<strong>clear_klasses</strong> &#x21d2; Object </a>
202
+
203
+
204
+
205
+ </span>
206
+
207
+
208
+
209
+
210
+
211
+
212
+
213
+
214
+
215
+ <span class="summary_desc"><div class='inline'></div></span>
216
+
217
+ </li>
218
+
219
+
220
+ <li class="public ">
221
+ <span class="summary_signature">
222
+
223
+ <a href="#clear_symbols-class_method" title="clear_symbols (class method)">.<strong>clear_symbols</strong> &#x21d2; Object </a>
224
+
225
+
226
+
227
+ </span>
228
+
229
+
230
+
231
+
232
+
233
+
234
+
235
+
236
+
237
+ <span class="summary_desc"><div class='inline'></div></span>
238
+
239
+ </li>
240
+
241
+
242
+ <li class="public ">
243
+ <span class="summary_signature">
244
+
245
+ <a href="#klass-class_method" title="klass (class method)">.<strong>klass</strong>(klass) &#x21d2; Object </a>
246
+
247
+
248
+
249
+ </span>
250
+
251
+
252
+
253
+
254
+
255
+
256
+
257
+
258
+
259
+ <span class="summary_desc"><div class='inline'></div></span>
260
+
261
+ </li>
262
+
263
+
264
+ <li class="public ">
265
+ <span class="summary_signature">
266
+
267
+ <a href="#option-class_method" title="option (class method)">.<strong>option</strong>(key, default: nil) &#x21d2; Object </a>
268
+
269
+
270
+
271
+ </span>
272
+
273
+
274
+
275
+
276
+
277
+
278
+
279
+
280
+
281
+ <span class="summary_desc"><div class='inline'></div></span>
282
+
283
+ </li>
284
+
285
+
286
+ <li class="public ">
287
+ <span class="summary_signature">
288
+
289
+ <a href="#register-class_method" title="register (class method)">.<strong>register</strong>(symbols: [], klasses: [], clear: true) &#x21d2; Object </a>
290
+
291
+
292
+
293
+ </span>
294
+
295
+
296
+
297
+
298
+
299
+
300
+
301
+
302
+
303
+ <span class="summary_desc"><div class='inline'></div></span>
304
+
305
+ </li>
306
+
307
+
308
+ <li class="public ">
309
+ <span class="summary_signature">
310
+
311
+ <a href="#symbol-class_method" title="symbol (class method)">.<strong>symbol</strong>(symbol) &#x21d2; Object </a>
312
+
313
+
314
+
315
+ </span>
316
+
317
+
318
+
319
+
320
+
321
+
322
+
323
+
324
+
325
+ <span class="summary_desc"><div class='inline'></div></span>
326
+
327
+ </li>
328
+
329
+
330
+ <li class="public ">
331
+ <span class="summary_signature">
332
+
333
+ <a href="#symbol_matches%3F-class_method" title="symbol_matches? (class method)">.<strong>symbol_matches?</strong>(type) &#x21d2; Boolean </a>
334
+
335
+
336
+
337
+ </span>
338
+
339
+
340
+
341
+
342
+
343
+
344
+
345
+
346
+
347
+ <span class="summary_desc"><div class='inline'></div></span>
348
+
349
+ </li>
350
+
351
+
352
+ <li class="public ">
353
+ <span class="summary_signature">
354
+
355
+ <a href="#type_matches%3F-class_method" title="type_matches? (class method)">.<strong>type_matches?</strong>(type) &#x21d2; Boolean </a>
356
+
357
+
358
+
359
+ </span>
360
+
361
+
362
+
363
+
364
+
365
+
366
+
367
+
368
+
369
+ <span class="summary_desc"><div class='inline'></div></span>
370
+
371
+ </li>
372
+
373
+
374
+ </ul>
375
+
376
+ <h2>
377
+ Instance Method Summary
378
+ <small><a href="#" class="summary_toggle">collapse</a></small>
379
+ </h2>
380
+
381
+ <ul class="summary">
382
+
383
+ <li class="public ">
384
+ <span class="summary_signature">
385
+
386
+ <a href="#exec_block-instance_method" title="#exec_block (instance method)">#<strong>exec_block</strong> &#x21d2; Object </a>
387
+
388
+
389
+
390
+ </span>
391
+
392
+
393
+
394
+
395
+
396
+
397
+
398
+
399
+
400
+ <span class="summary_desc"><div class='inline'></div></span>
401
+
402
+ </li>
403
+
404
+
405
+ <li class="public ">
406
+ <span class="summary_signature">
407
+
408
+ <a href="#initialize-instance_method" title="#initialize (instance method)">#<strong>initialize</strong>(options = {}) &#x21d2; Node </a>
409
+
410
+
411
+
412
+ </span>
413
+
414
+
415
+ <span class="note title constructor">constructor</span>
416
+
417
+
418
+
419
+
420
+
421
+
422
+
423
+
424
+ <span class="summary_desc"><div class='inline'><p>A new instance of Node.</p>
425
+ </div></span>
426
+
427
+ </li>
428
+
429
+
430
+ <li class="public ">
431
+ <span class="summary_signature">
432
+
433
+ <a href="#option-instance_method" title="#option (instance method)">#<strong>option</strong>(key) &#x21d2; Object </a>
434
+
435
+
436
+
437
+ </span>
438
+
439
+
440
+
441
+
442
+
443
+
444
+
445
+
446
+
447
+ <span class="summary_desc"><div class='inline'></div></span>
448
+
449
+ </li>
450
+
451
+
452
+ <li class="public ">
453
+ <span class="summary_signature">
454
+
455
+ <a href="#option%3F-instance_method" title="#option? (instance method)">#<strong>option?</strong>(key) &#x21d2; Boolean </a>
456
+
457
+
458
+
459
+ </span>
460
+
461
+
462
+
463
+
464
+
465
+
466
+
467
+
468
+
469
+ <span class="summary_desc"><div class='inline'></div></span>
470
+
471
+ </li>
472
+
473
+
474
+ <li class="public ">
475
+ <span class="summary_signature">
476
+
477
+ <a href="#resolve_type_klass-instance_method" title="#resolve_type_klass (instance method)">#<strong>resolve_type_klass</strong>(type) &#x21d2; Object </a>
478
+
479
+
480
+
481
+ </span>
482
+
483
+
484
+
485
+
486
+
487
+
488
+
489
+
490
+
491
+ <span class="summary_desc"><div class='inline'></div></span>
492
+
493
+ </li>
494
+
495
+
496
+ <li class="public ">
497
+ <span class="summary_signature">
498
+
499
+ <a href="#type_filter_matches%3F-instance_method" title="#type_filter_matches? (instance method)">#<strong>type_filter_matches?</strong>(data) &#x21d2; Boolean </a>
500
+
501
+
502
+
503
+ </span>
504
+
505
+
506
+
507
+
508
+
509
+
510
+
511
+
512
+
513
+ <span class="summary_desc"><div class='inline'></div></span>
514
+
515
+ </li>
516
+
517
+
518
+ <li class="public ">
519
+ <span class="summary_signature">
520
+
521
+ <a href="#type_label-instance_method" title="#type_label (instance method)">#<strong>type_label</strong> &#x21d2; Object </a>
522
+
523
+
524
+
525
+ </span>
526
+
527
+
528
+
529
+
530
+
531
+
532
+
533
+
534
+
535
+ <span class="summary_desc"><div class='inline'></div></span>
536
+
537
+ </li>
538
+
539
+
540
+ <li class="public ">
541
+ <span class="summary_signature">
542
+
543
+ <a href="#type_matches%3F-instance_method" title="#type_matches? (instance method)">#<strong>type_matches?</strong>(data) &#x21d2; Boolean </a>
544
+
545
+
546
+
547
+ </span>
548
+
549
+
550
+
551
+
552
+
553
+
554
+
555
+
556
+
557
+ <span class="summary_desc"><div class='inline'></div></span>
558
+
559
+ </li>
560
+
561
+
562
+ <li class="public ">
563
+ <span class="summary_signature">
564
+
565
+ <a href="#validate-instance_method" title="#validate (instance method)">#<strong>validate</strong>(data, collector) &#x21d2; Object </a>
566
+
567
+
568
+
569
+ </span>
570
+
571
+
572
+
573
+
574
+
575
+
576
+
577
+
578
+
579
+ <span class="summary_desc"><div class='inline'></div></span>
580
+
581
+ </li>
582
+
583
+
584
+ </ul>
585
+
586
+
587
+ <div id="constructor_details" class="method_details_list">
588
+ <h2>Constructor Details</h2>
589
+
590
+ <div class="method_details first">
591
+ <h3 class="signature first" id="initialize-instance_method">
592
+
593
+ #<strong>initialize</strong>(options = {}) &#x21d2; <tt><span class='object_link'><a href="" title="Schemacop::Node (class)">Node</a></span></tt>
594
+
595
+
596
+
597
+
598
+
599
+ </h3><div class="docstring">
600
+ <div class="discussion">
601
+ <p>Returns a new instance of Node</p>
602
+
603
+
604
+ </div>
605
+ </div>
606
+ <div class="tags">
607
+
608
+
609
+ </div><table class="source_code">
610
+ <tr>
611
+ <td>
612
+ <pre class="lines">
613
+
614
+
615
+ 76
616
+ 77
617
+ 78
618
+ 79
619
+ 80
620
+ 81
621
+ 82
622
+ 83</pre>
623
+ </td>
624
+ <td>
625
+ <pre class="code"><span class="info file"># File 'lib/schemacop/node.rb', line 76</span>
626
+
627
+ <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
+ <span class='comment'># Check and save given options
629
+ </span> <span class='ivar'>@options</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_allowed_options'>allowed_options</span><span class='period'>.</span><span class='id identifier rubyid_merge'>merge</span><span class='lparen'>(</span><span class='id identifier rubyid_options'>options</span><span class='rparen'>)</span>
630
+ <span class='kw'>if</span> <span class='lparen'>(</span><span class='id identifier rubyid_obsolete_opts'>obsolete_opts</span> <span class='op'>=</span> <span class='ivar'>@options</span><span class='period'>.</span><span class='id identifier rubyid_keys'>keys</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_allowed_options'>allowed_options</span><span class='period'>.</span><span class='id identifier rubyid_keys'>keys</span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_any?'>any?</span>
631
+ <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
+ <span class='tstring'><span class='tstring_beg'>&quot;</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'>&quot;</span></span>
633
+ <span class='kw'>end</span>
634
+ <span class='kw'>end</span></pre>
635
+ </td>
636
+ </tr>
637
+ </table>
638
+ </div>
639
+
640
+ </div>
641
+
642
+ <div id="instance_attr_details" class="attr_details">
643
+ <h2>Instance Attribute Details</h2>
644
+
645
+
646
+ <span id=""></span>
647
+ <div class="method_details first">
648
+ <h3 class="signature first" id="options-instance_method">
649
+
650
+ #<strong>options</strong> &#x21d2; <tt>Object</tt> <span class="extras">(readonly)</span>
651
+
652
+
653
+
654
+
655
+
656
+ </h3><div class="docstring">
657
+ <div class="discussion">
658
+ <p>Returns the value of attribute options</p>
659
+
660
+
661
+ </div>
662
+ </div>
663
+ <div class="tags">
664
+
665
+
666
+ </div><table class="source_code">
667
+ <tr>
668
+ <td>
669
+ <pre class="lines">
670
+
671
+
672
+ 3
673
+ 4
674
+ 5</pre>
675
+ </td>
676
+ <td>
677
+ <pre class="code"><span class="info file"># File 'lib/schemacop/node.rb', line 3</span>
678
+
679
+ <span class='kw'>def</span> <span class='id identifier rubyid_options'>options</span>
680
+ <span class='ivar'>@options</span>
681
+ <span class='kw'>end</span></pre>
682
+ </td>
683
+ </tr>
684
+ </table>
685
+ </div>
686
+
687
+ </div>
688
+
689
+
690
+ <div id="class_method_details" class="method_details_list">
691
+ <h2>Class Method Details</h2>
692
+
693
+
694
+ <div class="method_details first">
695
+ <h3 class="signature first" id="build-class_method">
696
+
697
+ .<strong>build</strong>(options, &amp;block) &#x21d2; <tt>Object</tt>
698
+
699
+
700
+
701
+
702
+
703
+ </h3><table class="source_code">
704
+ <tr>
705
+ <td>
706
+ <pre class="lines">
707
+
708
+
709
+ 72
710
+ 73
711
+ 74</pre>
712
+ </td>
713
+ <td>
714
+ <pre class="code"><span class="info file"># File 'lib/schemacop/node.rb', line 72</span>
715
+
716
+ <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'>&amp;</span><span class='id identifier rubyid_block'>block</span><span class='rparen'>)</span>
717
+ <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'>&amp;</span><span class='id identifier rubyid_block'>block</span><span class='rparen'>)</span>
718
+ <span class='kw'>end</span></pre>
719
+ </td>
720
+ </tr>
721
+ </table>
722
+ </div>
723
+
724
+ <div class="method_details ">
725
+ <h3 class="signature " id="class_matches?-class_method">
726
+
727
+ .<strong>class_matches?</strong>(type) &#x21d2; <tt>Boolean</tt>
728
+
729
+
730
+
731
+
732
+
733
+ </h3><div class="docstring">
734
+ <div class="discussion">
735
+
736
+
737
+ </div>
738
+ </div>
739
+ <div class="tags">
740
+
741
+ <p class="tag_title">Returns:</p>
742
+ <ul class="return">
743
+
744
+ <li>
745
+
746
+
747
+ <span class='type'>(<tt>Boolean</tt>)</span>
748
+
749
+
750
+
751
+ </li>
752
+
753
+ </ul>
754
+
755
+ </div><table class="source_code">
756
+ <tr>
757
+ <td>
758
+ <pre class="lines">
759
+
760
+
761
+ 64
762
+ 65
763
+ 66
764
+ 67
765
+ 68
766
+ 69
767
+ 70</pre>
768
+ </td>
769
+ <td>
770
+ <pre class="code"><span class="info file"># File 'lib/schemacop/node.rb', line 64</span>
771
+
772
+ <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
+ <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>
774
+ <span class='id identifier rubyid_klasses'>klasses</span><span class='period'>.</span><span class='id identifier rubyid_each'>each</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id identifier rubyid_klass'>klass</span><span class='op'>|</span>
775
+ <span class='kw'>return</span> <span class='kw'>true</span> <span class='kw'>if</span> <span class='id identifier rubyid_type'>type</span> <span class='op'>&lt;=</span> <span class='id identifier rubyid_klass'>klass</span>
776
+ <span class='kw'>end</span>
777
+ <span class='kw'>return</span> <span class='kw'>false</span>
778
+ <span class='kw'>end</span></pre>
779
+ </td>
780
+ </tr>
781
+ </table>
782
+ </div>
783
+
784
+ <div class="method_details ">
785
+ <h3 class="signature " id="clear_klasses-class_method">
786
+
787
+ .<strong>clear_klasses</strong> &#x21d2; <tt>Object</tt>
788
+
789
+
790
+
791
+
792
+
793
+ </h3><table class="source_code">
794
+ <tr>
795
+ <td>
796
+ <pre class="lines">
797
+
798
+
799
+ 39
800
+ 40
801
+ 41</pre>
802
+ </td>
803
+ <td>
804
+ <pre class="code"><span class="info file"># File 'lib/schemacop/node.rb', line 39</span>
805
+
806
+ <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
+ <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>
808
+ <span class='kw'>end</span></pre>
809
+ </td>
810
+ </tr>
811
+ </table>
812
+ </div>
813
+
814
+ <div class="method_details ">
815
+ <h3 class="signature " id="clear_symbols-class_method">
816
+
817
+ .<strong>clear_symbols</strong> &#x21d2; <tt>Object</tt>
818
+
819
+
820
+
821
+
822
+
823
+ </h3><table class="source_code">
824
+ <tr>
825
+ <td>
826
+ <pre class="lines">
827
+
828
+
829
+ 31
830
+ 32
831
+ 33</pre>
832
+ </td>
833
+ <td>
834
+ <pre class="code"><span class="info file"># File 'lib/schemacop/node.rb', line 31</span>
835
+
836
+ <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
+ <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>
838
+ <span class='kw'>end</span></pre>
839
+ </td>
840
+ </tr>
841
+ </table>
842
+ </div>
843
+
844
+ <div class="method_details ">
845
+ <h3 class="signature " id="klass-class_method">
846
+
847
+ .<strong>klass</strong>(klass) &#x21d2; <tt>Object</tt>
848
+
849
+
850
+
851
+
852
+
853
+ </h3><table class="source_code">
854
+ <tr>
855
+ <td>
856
+ <pre class="lines">
857
+
858
+
859
+ 35
860
+ 36
861
+ 37</pre>
862
+ </td>
863
+ <td>
864
+ <pre class="code"><span class="info file"># File 'lib/schemacop/node.rb', line 35</span>
865
+
866
+ <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
+ <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>
868
+ <span class='kw'>end</span></pre>
869
+ </td>
870
+ </tr>
871
+ </table>
872
+ </div>
873
+
874
+ <div class="method_details ">
875
+ <h3 class="signature " id="option-class_method">
876
+
877
+ .<strong>option</strong>(key, default: nil) &#x21d2; <tt>Object</tt>
878
+
879
+
880
+
881
+
882
+
883
+ </h3><table class="source_code">
884
+ <tr>
885
+ <td>
886
+ <pre class="lines">
887
+
888
+
889
+ 14
890
+ 15
891
+ 16</pre>
892
+ </td>
893
+ <td>
894
+ <pre class="code"><span class="info file"># File 'lib/schemacop/node.rb', line 14</span>
895
+
896
+ <span class='kw'>def</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_option'>option</span><span class='lparen'>(</span><span class='id identifier rubyid_key'>key</span><span class='comma'>,</span> <span class='label'>default:</span> <span class='kw'>nil</span><span class='rparen'>)</span>
897
+ <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_allowed_options'>allowed_options</span> <span class='op'>=</span> <span class='id identifier rubyid_allowed_options'>allowed_options</span><span class='period'>.</span><span class='id identifier rubyid_merge'>merge</span><span class='lparen'>(</span><span class='id identifier rubyid_key'>key</span> <span class='op'>=&gt;</span> <span class='id identifier rubyid_default'>default</span><span class='rparen'>)</span>
898
+ <span class='kw'>end</span></pre>
899
+ </td>
900
+ </tr>
901
+ </table>
902
+ </div>
903
+
904
+ <div class="method_details ">
905
+ <h3 class="signature " id="register-class_method">
906
+
907
+ .<strong>register</strong>(symbols: [], klasses: [], clear: true) &#x21d2; <tt>Object</tt>
908
+
909
+
910
+
911
+
912
+
913
+ </h3><table class="source_code">
914
+ <tr>
915
+ <td>
916
+ <pre class="lines">
917
+
918
+
919
+ 43
920
+ 44
921
+ 45
922
+ 46
923
+ 47
924
+ 48
925
+ 49
926
+ 50
927
+ 51
928
+ 52
929
+ 53</pre>
930
+ </td>
931
+ <td>
932
+ <pre class="code"><span class="info file"># File 'lib/schemacop/node.rb', line 43</span>
933
+
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>
936
+ <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
+ <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
+ <span class='kw'>if</span> <span class='id identifier rubyid_clear'>clear</span>
939
+ <span class='id identifier rubyid_clear_symbols'>clear_symbols</span>
940
+ <span class='id identifier rubyid_clear_klasses'>clear_klasses</span>
941
+ <span class='kw'>end</span>
942
+ <span class='id identifier rubyid_symbols'>symbols</span><span class='period'>.</span><span class='id identifier rubyid_each'>each</span> <span class='lbrace'>{</span> <span class='op'>|</span><span class='id identifier rubyid_s'>s</span><span class='op'>|</span> <span class='id identifier rubyid_symbol'>symbol</span> <span class='id identifier rubyid_s'>s</span> <span class='rbrace'>}</span>
943
+ <span class='id identifier rubyid_klasses'>klasses</span><span class='period'>.</span><span class='id identifier rubyid_each'>each</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_klass'>klass</span> <span class='id identifier rubyid_k'>k</span> <span class='rbrace'>}</span>
944
+ <span class='kw'>end</span></pre>
945
+ </td>
946
+ </tr>
947
+ </table>
948
+ </div>
949
+
950
+ <div class="method_details ">
951
+ <h3 class="signature " id="symbol-class_method">
952
+
953
+ .<strong>symbol</strong>(symbol) &#x21d2; <tt>Object</tt>
954
+
955
+
956
+
957
+
958
+
959
+ </h3><table class="source_code">
960
+ <tr>
961
+ <td>
962
+ <pre class="lines">
963
+
964
+
965
+ 27
966
+ 28
967
+ 29</pre>
968
+ </td>
969
+ <td>
970
+ <pre class="code"><span class="info file"># File 'lib/schemacop/node.rb', line 27</span>
971
+
972
+ <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
+ <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>
974
+ <span class='kw'>end</span></pre>
975
+ </td>
976
+ </tr>
977
+ </table>
978
+ </div>
979
+
980
+ <div class="method_details ">
981
+ <h3 class="signature " id="symbol_matches?-class_method">
982
+
983
+ .<strong>symbol_matches?</strong>(type) &#x21d2; <tt>Boolean</tt>
984
+
985
+
986
+
987
+
988
+
989
+ </h3><div class="docstring">
990
+ <div class="discussion">
991
+
992
+
993
+ </div>
994
+ </div>
995
+ <div class="tags">
996
+
997
+ <p class="tag_title">Returns:</p>
998
+ <ul class="return">
999
+
1000
+ <li>
1001
+
1002
+
1003
+ <span class='type'>(<tt>Boolean</tt>)</span>
1004
+
1005
+
1006
+
1007
+ </li>
1008
+
1009
+ </ul>
1010
+
1011
+ </div><table class="source_code">
1012
+ <tr>
1013
+ <td>
1014
+ <pre class="lines">
1015
+
1016
+
1017
+ 59
1018
+ 60
1019
+ 61
1020
+ 62</pre>
1021
+ </td>
1022
+ <td>
1023
+ <pre class="code"><span class="info file"># File 'lib/schemacop/node.rb', line 59</span>
1024
+
1025
+ <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
+ <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>
1027
+ <span class='id identifier rubyid_symbols'>symbols</span><span class='period'>.</span><span class='id identifier rubyid_include?'>include?</span><span class='lparen'>(</span><span class='id identifier rubyid_type'>type</span><span class='rparen'>)</span>
1028
+ <span class='kw'>end</span></pre>
1029
+ </td>
1030
+ </tr>
1031
+ </table>
1032
+ </div>
1033
+
1034
+ <div class="method_details ">
1035
+ <h3 class="signature " id="type_matches?-class_method">
1036
+
1037
+ .<strong>type_matches?</strong>(type) &#x21d2; <tt>Boolean</tt>
1038
+
1039
+
1040
+
1041
+
1042
+
1043
+ </h3><div class="docstring">
1044
+ <div class="discussion">
1045
+
1046
+
1047
+ </div>
1048
+ </div>
1049
+ <div class="tags">
1050
+
1051
+ <p class="tag_title">Returns:</p>
1052
+ <ul class="return">
1053
+
1054
+ <li>
1055
+
1056
+
1057
+ <span class='type'>(<tt>Boolean</tt>)</span>
1058
+
1059
+
1060
+
1061
+ </li>
1062
+
1063
+ </ul>
1064
+
1065
+ </div><table class="source_code">
1066
+ <tr>
1067
+ <td>
1068
+ <pre class="lines">
1069
+
1070
+
1071
+ 55
1072
+ 56
1073
+ 57</pre>
1074
+ </td>
1075
+ <td>
1076
+ <pre class="code"><span class="info file"># File 'lib/schemacop/node.rb', line 55</span>
1077
+
1078
+ <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
+ <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>
1080
+ <span class='kw'>end</span></pre>
1081
+ </td>
1082
+ </tr>
1083
+ </table>
1084
+ </div>
1085
+
1086
+ </div>
1087
+
1088
+ <div id="instance_method_details" class="method_details_list">
1089
+ <h2>Instance Method Details</h2>
1090
+
1091
+
1092
+ <div class="method_details first">
1093
+ <h3 class="signature first" id="exec_block-instance_method">
1094
+
1095
+ #<strong>exec_block</strong> &#x21d2; <tt>Object</tt>
1096
+
1097
+
1098
+
1099
+
1100
+
1101
+ </h3><table class="source_code">
1102
+ <tr>
1103
+ <td>
1104
+ <pre class="lines">
1105
+
1106
+
1107
+ 95
1108
+ 96
1109
+ 97</pre>
1110
+ </td>
1111
+ <td>
1112
+ <pre class="code"><span class="info file"># File 'lib/schemacop/node.rb', line 95</span>
1113
+
1114
+ <span class='kw'>def</span> <span class='id identifier rubyid_exec_block'>exec_block</span>
1115
+ <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'>&#39;</span><span class='tstring_content'>Node does not support block.</span><span class='tstring_end'>&#39;</span></span> <span class='kw'>if</span> <span class='id identifier rubyid_block_given?'>block_given?</span>
1116
+ <span class='kw'>end</span></pre>
1117
+ </td>
1118
+ </tr>
1119
+ </table>
1120
+ </div>
1121
+
1122
+ <div class="method_details ">
1123
+ <h3 class="signature " id="option-instance_method">
1124
+
1125
+ #<strong>option</strong>(key) &#x21d2; <tt>Object</tt>
1126
+
1127
+
1128
+
1129
+
1130
+
1131
+ </h3><table class="source_code">
1132
+ <tr>
1133
+ <td>
1134
+ <pre class="lines">
1135
+
1136
+
1137
+ 85
1138
+ 86
1139
+ 87</pre>
1140
+ </td>
1141
+ <td>
1142
+ <pre class="code"><span class="info file"># File 'lib/schemacop/node.rb', line 85</span>
1143
+
1144
+ <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
+ <span class='id identifier rubyid_options'>options</span><span class='lbracket'>[</span><span class='id identifier rubyid_key'>key</span><span class='rbracket'>]</span>
1146
+ <span class='kw'>end</span></pre>
1147
+ </td>
1148
+ </tr>
1149
+ </table>
1150
+ </div>
1151
+
1152
+ <div class="method_details ">
1153
+ <h3 class="signature " id="option?-instance_method">
1154
+
1155
+ #<strong>option?</strong>(key) &#x21d2; <tt>Boolean</tt>
1156
+
1157
+
1158
+
1159
+
1160
+
1161
+ </h3><div class="docstring">
1162
+ <div class="discussion">
1163
+
1164
+
1165
+ </div>
1166
+ </div>
1167
+ <div class="tags">
1168
+
1169
+ <p class="tag_title">Returns:</p>
1170
+ <ul class="return">
1171
+
1172
+ <li>
1173
+
1174
+
1175
+ <span class='type'>(<tt>Boolean</tt>)</span>
1176
+
1177
+
1178
+
1179
+ </li>
1180
+
1181
+ </ul>
1182
+
1183
+ </div><table class="source_code">
1184
+ <tr>
1185
+ <td>
1186
+ <pre class="lines">
1187
+
1188
+
1189
+ 89
1190
+ 90
1191
+ 91
1192
+ 92
1193
+ 93</pre>
1194
+ </td>
1195
+ <td>
1196
+ <pre class="code"><span class="info file"># File 'lib/schemacop/node.rb', line 89</span>
1197
+
1198
+ <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
+ <span class='comment'># rubocop:disable Style/DoubleNegation
1200
+ </span> <span class='op'>!</span><span class='op'>!</span><span class='id identifier rubyid_options'>options</span><span class='lbracket'>[</span><span class='id identifier rubyid_key'>key</span><span class='rbracket'>]</span>
1201
+ <span class='comment'># rubocop:enable Style/DoubleNegation
1202
+ </span><span class='kw'>end</span></pre>
1203
+ </td>
1204
+ </tr>
1205
+ </table>
1206
+ </div>
1207
+
1208
+ <div class="method_details ">
1209
+ <h3 class="signature " id="resolve_type_klass-instance_method">
1210
+
1211
+ #<strong>resolve_type_klass</strong>(type) &#x21d2; <tt>Object</tt>
1212
+
1213
+
1214
+
1215
+
1216
+
1217
+ </h3><table class="source_code">
1218
+ <tr>
1219
+ <td>
1220
+ <pre class="lines">
1221
+
1222
+
1223
+ 99
1224
+ 100
1225
+ 101
1226
+ 102
1227
+ 103
1228
+ 104
1229
+ 105</pre>
1230
+ </td>
1231
+ <td>
1232
+ <pre class="code"><span class="info file"># File 'lib/schemacop/node.rb', line 99</span>
1233
+
1234
+ <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
+ <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>
1236
+ <span class='kw'>unless</span> <span class='id identifier rubyid_klass'>klass</span>
1237
+ <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'>&quot;</span><span class='tstring_content'>No validation class found for type </span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_type'>type</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'>&quot;</span></span>
1238
+ <span class='kw'>end</span>
1239
+ <span class='kw'>return</span> <span class='id identifier rubyid_klass'>klass</span>
1240
+ <span class='kw'>end</span></pre>
1241
+ </td>
1242
+ </tr>
1243
+ </table>
1244
+ </div>
1245
+
1246
+ <div class="method_details ">
1247
+ <h3 class="signature " id="type_filter_matches?-instance_method">
1248
+
1249
+ #<strong>type_filter_matches?</strong>(data) &#x21d2; <tt>Boolean</tt>
1250
+
1251
+
1252
+
1253
+
1254
+
1255
+ </h3><div class="docstring">
1256
+ <div class="discussion">
1257
+
1258
+
1259
+ </div>
1260
+ </div>
1261
+ <div class="tags">
1262
+
1263
+ <p class="tag_title">Returns:</p>
1264
+ <ul class="return">
1265
+
1266
+ <li>
1267
+
1268
+
1269
+ <span class='type'>(<tt>Boolean</tt>)</span>
1270
+
1271
+
1272
+
1273
+ </li>
1274
+
1275
+ </ul>
1276
+
1277
+ </div><table class="source_code">
1278
+ <tr>
1279
+ <td>
1280
+ <pre class="lines">
1281
+
1282
+
1283
+ 115
1284
+ 116
1285
+ 117</pre>
1286
+ </td>
1287
+ <td>
1288
+ <pre class="code"><span class="info file"># File 'lib/schemacop/node.rb', line 115</span>
1289
+
1290
+ <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
+ <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>
1292
+ <span class='kw'>end</span></pre>
1293
+ </td>
1294
+ </tr>
1295
+ </table>
1296
+ </div>
1297
+
1298
+ <div class="method_details ">
1299
+ <h3 class="signature " id="type_label-instance_method">
1300
+
1301
+ #<strong>type_label</strong> &#x21d2; <tt>Object</tt>
1302
+
1303
+
1304
+
1305
+
1306
+
1307
+ </h3><table class="source_code">
1308
+ <tr>
1309
+ <td>
1310
+ <pre class="lines">
1311
+
1312
+
1313
+ 21
1314
+ 22
1315
+ 23
1316
+ 24
1317
+ 25</pre>
1318
+ </td>
1319
+ <td>
1320
+ <pre class="code"><span class="info file"># File 'lib/schemacop/node.rb', line 21</span>
1321
+
1322
+ <span class='kw'>def</span> <span class='id identifier rubyid_type_label'>type_label</span>
1323
+ <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'>&#39;</span><span class='tstring_content'>unknown</span><span class='tstring_end'>&#39;</span></span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_to_s'>to_s</span>
1324
+ <span class='id identifier rubyid_str'>str</span> <span class='op'>+=</span> <span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>*</span><span class='tstring_end'>&#39;</span></span> <span class='kw'>if</span> <span class='id identifier rubyid_option?'>option?</span><span class='lparen'>(</span><span class='symbol'>:if</span><span class='rparen'>)</span>
1325
+ <span class='kw'>return</span> <span class='id identifier rubyid_str'>str</span>
1326
+ <span class='kw'>end</span></pre>
1327
+ </td>
1328
+ </tr>
1329
+ </table>
1330
+ </div>
1331
+
1332
+ <div class="method_details ">
1333
+ <h3 class="signature " id="type_matches?-instance_method">
1334
+
1335
+ #<strong>type_matches?</strong>(data) &#x21d2; <tt>Boolean</tt>
1336
+
1337
+
1338
+
1339
+
1340
+
1341
+ </h3><div class="docstring">
1342
+ <div class="discussion">
1343
+
1344
+
1345
+ </div>
1346
+ </div>
1347
+ <div class="tags">
1348
+
1349
+ <p class="tag_title">Returns:</p>
1350
+ <ul class="return">
1351
+
1352
+ <li>
1353
+
1354
+
1355
+ <span class='type'>(<tt>Boolean</tt>)</span>
1356
+
1357
+
1358
+
1359
+ </li>
1360
+
1361
+ </ul>
1362
+
1363
+ </div><table class="source_code">
1364
+ <tr>
1365
+ <td>
1366
+ <pre class="lines">
1367
+
1368
+
1369
+ 111
1370
+ 112
1371
+ 113</pre>
1372
+ </td>
1373
+ <td>
1374
+ <pre class="code"><span class="info file"># File 'lib/schemacop/node.rb', line 111</span>
1375
+
1376
+ <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
+ <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'>&amp;&amp;</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>
1378
+ <span class='kw'>end</span></pre>
1379
+ </td>
1380
+ </tr>
1381
+ </table>
1382
+ </div>
1383
+
1384
+ <div class="method_details ">
1385
+ <h3 class="signature " id="validate-instance_method">
1386
+
1387
+ #<strong>validate</strong>(data, collector) &#x21d2; <tt>Object</tt>
1388
+
1389
+
1390
+
1391
+
1392
+
1393
+ </h3><table class="source_code">
1394
+ <tr>
1395
+ <td>
1396
+ <pre class="lines">
1397
+
1398
+
1399
+ 107
1400
+ 108
1401
+ 109</pre>
1402
+ </td>
1403
+ <td>
1404
+ <pre class="code"><span class="info file"># File 'lib/schemacop/node.rb', line 107</span>
1405
+
1406
+ <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
+ <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>
1408
+ <span class='kw'>end</span></pre>
1409
+ </td>
1410
+ </tr>
1411
+ </table>
1412
+ </div>
1413
+
1414
+ </div>
1415
+
1416
+ </div>
1417
+
1418
+ <div id="footer">
1419
+ Generated on Mon May 15 17:46:05 2017 by
1420
+ <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
1421
+ 0.9.9 (ruby-2.3.1).
1422
+ </div>
1423
+
1424
+ </div>
1425
+ </body>
1426
+ </html>