schemacop 2.4.6 → 3.0.0.rc3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (174) hide show
  1. checksums.yaml +4 -4
  2. data/.gitignore +3 -0
  3. data/.releaser_config +0 -1
  4. data/.rubocop.yml +25 -1
  5. data/.travis.yml +3 -1
  6. data/CHANGELOG.md +33 -0
  7. data/README.md +53 -710
  8. data/README_V2.md +775 -0
  9. data/README_V3.md +1197 -0
  10. data/Rakefile +8 -12
  11. data/VERSION +1 -1
  12. data/lib/schemacop.rb +35 -36
  13. data/lib/schemacop/base_schema.rb +37 -0
  14. data/lib/schemacop/railtie.rb +10 -0
  15. data/lib/schemacop/schema.rb +1 -60
  16. data/lib/schemacop/schema2.rb +22 -0
  17. data/lib/schemacop/schema3.rb +21 -0
  18. data/lib/schemacop/scoped_env.rb +25 -13
  19. data/lib/schemacop/v2.rb +25 -0
  20. data/lib/schemacop/{caster.rb → v2/caster.rb} +16 -2
  21. data/lib/schemacop/{collector.rb → v2/collector.rb} +5 -2
  22. data/lib/schemacop/{dupper.rb → v2/dupper.rb} +1 -1
  23. data/lib/schemacop/{field_node.rb → v2/field_node.rb} +4 -3
  24. data/lib/schemacop/v2/node.rb +142 -0
  25. data/lib/schemacop/{node_resolver.rb → v2/node_resolver.rb} +1 -1
  26. data/lib/schemacop/v2/node_supporting_field.rb +70 -0
  27. data/lib/schemacop/{node_supporting_type.rb → v2/node_supporting_type.rb} +8 -5
  28. data/lib/schemacop/{node_with_block.rb → v2/node_with_block.rb} +3 -2
  29. data/lib/schemacop/v2/root_node.rb +0 -0
  30. data/lib/schemacop/v2/validator/array_validator.rb +32 -0
  31. data/lib/schemacop/{validator → v2/validator}/boolean_validator.rb +1 -1
  32. data/lib/schemacop/v2/validator/float_validator.rb +7 -0
  33. data/lib/schemacop/v2/validator/hash_validator.rb +37 -0
  34. data/lib/schemacop/v2/validator/integer_validator.rb +7 -0
  35. data/lib/schemacop/{validator → v2/validator}/nil_validator.rb +1 -1
  36. data/lib/schemacop/v2/validator/number_validator.rb +21 -0
  37. data/lib/schemacop/v2/validator/object_validator.rb +29 -0
  38. data/lib/schemacop/v2/validator/string_validator.rb +39 -0
  39. data/lib/schemacop/{validator → v2/validator}/symbol_validator.rb +1 -1
  40. data/lib/schemacop/v3.rb +45 -0
  41. data/lib/schemacop/v3/all_of_node.rb +27 -0
  42. data/lib/schemacop/v3/any_of_node.rb +28 -0
  43. data/lib/schemacop/v3/array_node.rb +218 -0
  44. data/lib/schemacop/v3/boolean_node.rb +16 -0
  45. data/lib/schemacop/v3/combination_node.rb +45 -0
  46. data/lib/schemacop/v3/context.rb +17 -0
  47. data/lib/schemacop/v3/dsl_scope.rb +46 -0
  48. data/lib/schemacop/v3/global_context.rb +114 -0
  49. data/lib/schemacop/v3/hash_node.rb +258 -0
  50. data/lib/schemacop/v3/integer_node.rb +13 -0
  51. data/lib/schemacop/v3/is_not_node.rb +32 -0
  52. data/lib/schemacop/v3/node.rb +219 -0
  53. data/lib/schemacop/v3/node_registry.rb +49 -0
  54. data/lib/schemacop/v3/number_node.rb +18 -0
  55. data/lib/schemacop/v3/numeric_node.rb +76 -0
  56. data/lib/schemacop/v3/object_node.rb +40 -0
  57. data/lib/schemacop/v3/one_of_node.rb +28 -0
  58. data/lib/schemacop/v3/reference_node.rb +49 -0
  59. data/lib/schemacop/v3/result.rb +58 -0
  60. data/lib/schemacop/v3/string_node.rb +124 -0
  61. data/lib/schemacop/v3/symbol_node.rb +13 -0
  62. data/schemacop.gemspec +24 -27
  63. data/test/lib/test_helper.rb +152 -0
  64. data/test/schemas/nested/group.rb +6 -0
  65. data/test/schemas/user.rb +7 -0
  66. data/test/unit/schemacop/v2/casting_test.rb +120 -0
  67. data/test/unit/schemacop/v2/collector_test.rb +47 -0
  68. data/test/unit/schemacop/v2/custom_check_test.rb +95 -0
  69. data/test/unit/schemacop/v2/custom_if_test.rb +97 -0
  70. data/test/unit/schemacop/v2/defaults_test.rb +95 -0
  71. data/test/unit/schemacop/v2/empty_test.rb +16 -0
  72. data/test/unit/schemacop/v2/nil_dis_allow_test.rb +43 -0
  73. data/test/unit/schemacop/v2/node_resolver_test.rb +28 -0
  74. data/test/unit/schemacop/v2/short_forms_test.rb +351 -0
  75. data/test/unit/schemacop/v2/types_test.rb +88 -0
  76. data/test/unit/schemacop/v2/validator_array_test.rb +99 -0
  77. data/test/unit/schemacop/v2/validator_boolean_test.rb +17 -0
  78. data/test/unit/schemacop/v2/validator_float_test.rb +59 -0
  79. data/test/unit/schemacop/v2/validator_hash_test.rb +95 -0
  80. data/test/unit/schemacop/v2/validator_integer_test.rb +48 -0
  81. data/test/unit/schemacop/v2/validator_nil_test.rb +15 -0
  82. data/test/unit/schemacop/v2/validator_number_test.rb +62 -0
  83. data/test/unit/schemacop/v2/validator_object_test.rb +141 -0
  84. data/test/unit/schemacop/v2/validator_string_test.rb +78 -0
  85. data/test/unit/schemacop/v2/validator_symbol_test.rb +18 -0
  86. data/test/unit/schemacop/v3/all_of_node_test.rb +198 -0
  87. data/test/unit/schemacop/v3/any_of_node_test.rb +218 -0
  88. data/test/unit/schemacop/v3/array_node_test.rb +815 -0
  89. data/test/unit/schemacop/v3/boolean_node_test.rb +126 -0
  90. data/test/unit/schemacop/v3/global_context_test.rb +164 -0
  91. data/test/unit/schemacop/v3/hash_node_test.rb +884 -0
  92. data/test/unit/schemacop/v3/integer_node_test.rb +323 -0
  93. data/test/unit/schemacop/v3/is_not_node_test.rb +173 -0
  94. data/test/unit/schemacop/v3/node_test.rb +148 -0
  95. data/test/unit/schemacop/v3/number_node_test.rb +292 -0
  96. data/test/unit/schemacop/v3/object_node_test.rb +170 -0
  97. data/test/unit/schemacop/v3/one_of_node_test.rb +187 -0
  98. data/test/unit/schemacop/v3/reference_node_test.rb +351 -0
  99. data/test/unit/schemacop/v3/string_node_test.rb +334 -0
  100. data/test/unit/schemacop/v3/symbol_node_test.rb +75 -0
  101. metadata +157 -150
  102. data/doc/Schemacop.html +0 -146
  103. data/doc/Schemacop/ArrayValidator.html +0 -329
  104. data/doc/Schemacop/BooleanValidator.html +0 -145
  105. data/doc/Schemacop/Caster.html +0 -379
  106. data/doc/Schemacop/Collector.html +0 -787
  107. data/doc/Schemacop/Dupper.html +0 -214
  108. data/doc/Schemacop/Exceptions.html +0 -115
  109. data/doc/Schemacop/Exceptions/InvalidSchemaError.html +0 -124
  110. data/doc/Schemacop/Exceptions/ValidationError.html +0 -124
  111. data/doc/Schemacop/FieldNode.html +0 -421
  112. data/doc/Schemacop/FloatValidator.html +0 -158
  113. data/doc/Schemacop/HashValidator.html +0 -293
  114. data/doc/Schemacop/IntegerValidator.html +0 -158
  115. data/doc/Schemacop/NilValidator.html +0 -145
  116. data/doc/Schemacop/Node.html +0 -1438
  117. data/doc/Schemacop/NodeResolver.html +0 -258
  118. data/doc/Schemacop/NodeSupportingField.html +0 -590
  119. data/doc/Schemacop/NodeSupportingType.html +0 -612
  120. data/doc/Schemacop/NodeWithBlock.html +0 -289
  121. data/doc/Schemacop/NumberValidator.html +0 -232
  122. data/doc/Schemacop/ObjectValidator.html +0 -298
  123. data/doc/Schemacop/RootNode.html +0 -171
  124. data/doc/Schemacop/Schema.html +0 -699
  125. data/doc/Schemacop/StringValidator.html +0 -295
  126. data/doc/Schemacop/SymbolValidator.html +0 -145
  127. data/doc/ScopedEnv.html +0 -351
  128. data/doc/_index.html +0 -379
  129. data/doc/class_list.html +0 -51
  130. data/doc/css/common.css +0 -1
  131. data/doc/css/full_list.css +0 -58
  132. data/doc/css/style.css +0 -496
  133. data/doc/file.README.html +0 -833
  134. data/doc/file_list.html +0 -56
  135. data/doc/frames.html +0 -17
  136. data/doc/index.html +0 -833
  137. data/doc/inheritance.graphml +0 -524
  138. data/doc/inheritance.pdf +0 -825
  139. data/doc/js/app.js +0 -303
  140. data/doc/js/full_list.js +0 -216
  141. data/doc/js/jquery.js +0 -4
  142. data/doc/method_list.html +0 -587
  143. data/doc/top-level-namespace.html +0 -112
  144. data/lib/schemacop/node.rb +0 -139
  145. data/lib/schemacop/node_supporting_field.rb +0 -58
  146. data/lib/schemacop/root_node.rb +0 -4
  147. data/lib/schemacop/validator/array_validator.rb +0 -30
  148. data/lib/schemacop/validator/float_validator.rb +0 -5
  149. data/lib/schemacop/validator/hash_validator.rb +0 -35
  150. data/lib/schemacop/validator/integer_validator.rb +0 -5
  151. data/lib/schemacop/validator/number_validator.rb +0 -19
  152. data/lib/schemacop/validator/object_validator.rb +0 -27
  153. data/lib/schemacop/validator/string_validator.rb +0 -37
  154. data/test/casting_test.rb +0 -100
  155. data/test/collector_test.rb +0 -45
  156. data/test/custom_check_test.rb +0 -93
  157. data/test/custom_if_test.rb +0 -95
  158. data/test/defaults_test.rb +0 -93
  159. data/test/empty_test.rb +0 -14
  160. data/test/nil_dis_allow_test.rb +0 -41
  161. data/test/node_resolver_test.rb +0 -26
  162. data/test/short_forms_test.rb +0 -349
  163. data/test/test_helper.rb +0 -13
  164. data/test/types_test.rb +0 -84
  165. data/test/validator_array_test.rb +0 -97
  166. data/test/validator_boolean_test.rb +0 -15
  167. data/test/validator_float_test.rb +0 -57
  168. data/test/validator_hash_test.rb +0 -93
  169. data/test/validator_integer_test.rb +0 -46
  170. data/test/validator_nil_test.rb +0 -13
  171. data/test/validator_number_test.rb +0 -60
  172. data/test/validator_object_test.rb +0 -139
  173. data/test/validator_string_test.rb +0 -76
  174. data/test/validator_symbol_test.rb +0 -16
@@ -1,787 +0,0 @@
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::Collector
8
-
9
- &mdash; Documentation by YARD 0.9.20
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::Collector";
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 (C)</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">Collector</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::Collector
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::Collector</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/collector.rb</dd>
98
- </dl>
99
-
100
- </div>
101
-
102
-
103
-
104
-
105
-
106
- <h2>Instance Attribute Summary <small><a href="#" class="summary_toggle">collapse</a></small></h2>
107
- <ul class="summary">
108
-
109
- <li class="public ">
110
- <span class="summary_signature">
111
-
112
- <a href="#exceptions-instance_method" title="#exceptions (instance method)">#<strong>exceptions</strong> &#x21d2; Object </a>
113
-
114
-
115
-
116
- </span>
117
-
118
-
119
-
120
-
121
- <span class="note title readonly">readonly</span>
122
-
123
-
124
-
125
-
126
-
127
-
128
-
129
-
130
-
131
- <span class="summary_desc"><div class='inline'><p>Returns the value of attribute exceptions.</p>
132
- </div></span>
133
-
134
- </li>
135
-
136
-
137
- </ul>
138
-
139
-
140
-
141
-
142
-
143
- <h2>
144
- Instance Method Summary
145
- <small><a href="#" class="summary_toggle">collapse</a></small>
146
- </h2>
147
-
148
- <ul class="summary">
149
-
150
- <li class="public ">
151
- <span class="summary_signature">
152
-
153
- <a href="#data-instance_method" title="#data (instance method)">#<strong>data</strong> &#x21d2; Object </a>
154
-
155
-
156
-
157
- </span>
158
-
159
-
160
-
161
-
162
-
163
-
164
-
165
-
166
-
167
- <span class="summary_desc"><div class='inline'></div></span>
168
-
169
- </li>
170
-
171
-
172
- <li class="public ">
173
- <span class="summary_signature">
174
-
175
- <a href="#error-instance_method" title="#error (instance method)">#<strong>error</strong>(error_msg) &#x21d2; Object </a>
176
-
177
-
178
-
179
- </span>
180
-
181
-
182
-
183
-
184
-
185
-
186
-
187
-
188
-
189
- <span class="summary_desc"><div class='inline'></div></span>
190
-
191
- </li>
192
-
193
-
194
- <li class="public ">
195
- <span class="summary_signature">
196
-
197
- <a href="#exception_message-instance_method" title="#exception_message (instance method)">#<strong>exception_message</strong> &#x21d2; Object </a>
198
-
199
-
200
-
201
- </span>
202
-
203
-
204
-
205
-
206
-
207
-
208
-
209
-
210
-
211
- <span class="summary_desc"><div class='inline'></div></span>
212
-
213
- </li>
214
-
215
-
216
- <li class="public ">
217
- <span class="summary_signature">
218
-
219
- <a href="#ignore_next_segment-instance_method" title="#ignore_next_segment (instance method)">#<strong>ignore_next_segment</strong> &#x21d2; Schemacop::Collector </a>
220
-
221
-
222
-
223
- </span>
224
-
225
-
226
-
227
-
228
-
229
-
230
-
231
-
232
-
233
- <span class="summary_desc"><div class='inline'><p>Does not include the path segment next time path is called.</p>
234
- </div></span>
235
-
236
- </li>
237
-
238
-
239
- <li class="public ">
240
- <span class="summary_signature">
241
-
242
- <a href="#initialize-instance_method" title="#initialize (instance method)">#<strong>initialize</strong>(data) &#x21d2; Collector </a>
243
-
244
-
245
-
246
- </span>
247
-
248
-
249
- <span class="note title constructor">constructor</span>
250
-
251
-
252
-
253
-
254
-
255
-
256
-
257
-
258
- <span class="summary_desc"><div class='inline'><p>A new instance of Collector.</p>
259
- </div></span>
260
-
261
- </li>
262
-
263
-
264
- <li class="public ">
265
- <span class="summary_signature">
266
-
267
- <a href="#override_value-instance_method" title="#override_value (instance method)">#<strong>override_value</strong>(value) &#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="#path-instance_method" title="#path (instance method)">#<strong>path</strong>(segment, index, type) &#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'><p>Construct the current path.</p>
304
- </div></span>
305
-
306
- </li>
307
-
308
-
309
- <li class="public ">
310
- <span class="summary_signature">
311
-
312
- <a href="#valid%3F-instance_method" title="#valid? (instance method)">#<strong>valid?</strong> &#x21d2; Boolean </a>
313
-
314
-
315
-
316
- </span>
317
-
318
-
319
-
320
-
321
-
322
-
323
-
324
-
325
-
326
- <span class="summary_desc"><div class='inline'></div></span>
327
-
328
- </li>
329
-
330
-
331
- </ul>
332
-
333
-
334
- <div id="constructor_details" class="method_details_list">
335
- <h2>Constructor Details</h2>
336
-
337
- <div class="method_details first">
338
- <h3 class="signature first" id="initialize-instance_method">
339
-
340
- #<strong>initialize</strong>(data) &#x21d2; <tt><span class='object_link'><a href="" title="Schemacop::Collector (class)">Collector</a></span></tt>
341
-
342
-
343
-
344
-
345
-
346
- </h3><div class="docstring">
347
- <div class="discussion">
348
- <p>Returns a new instance of Collector</p>
349
-
350
-
351
- </div>
352
- </div>
353
- <div class="tags">
354
-
355
-
356
- </div><table class="source_code">
357
- <tr>
358
- <td>
359
- <pre class="lines">
360
-
361
-
362
- 5
363
- 6
364
- 7
365
- 8
366
- 9
367
- 10
368
- 11</pre>
369
- </td>
370
- <td>
371
- <pre class="code"><span class="info file"># File 'lib/schemacop/collector.rb', line 5</span>
372
-
373
- <span class='kw'>def</span> <span class='id identifier rubyid_initialize'>initialize</span><span class='lparen'>(</span><span class='id identifier rubyid_data'>data</span><span class='rparen'>)</span>
374
- <span class='ivar'>@exceptions</span> <span class='op'>=</span> <span class='lbracket'>[</span><span class='rbracket'>]</span>
375
- <span class='ivar'>@current_path</span> <span class='op'>=</span> <span class='lbracket'>[</span><span class='rbracket'>]</span>
376
- <span class='ivar'>@ignore_next_segment</span> <span class='op'>=</span> <span class='kw'>false</span>
377
- <span class='ivar'>@current_datappoint_path</span> <span class='op'>=</span> <span class='lbracket'>[</span><span class='id identifier rubyid_data'>data</span><span class='rbracket'>]</span>
378
- <span class='ivar'>@current_index</span> <span class='op'>=</span> <span class='kw'>nil</span>
379
- <span class='kw'>end</span></pre>
380
- </td>
381
- </tr>
382
- </table>
383
- </div>
384
-
385
- </div>
386
-
387
- <div id="instance_attr_details" class="attr_details">
388
- <h2>Instance Attribute Details</h2>
389
-
390
-
391
- <span id=""></span>
392
- <div class="method_details first">
393
- <h3 class="signature first" id="exceptions-instance_method">
394
-
395
- #<strong>exceptions</strong> &#x21d2; <tt>Object</tt> <span class="extras">(readonly)</span>
396
-
397
-
398
-
399
-
400
-
401
- </h3><div class="docstring">
402
- <div class="discussion">
403
- <p>Returns the value of attribute exceptions</p>
404
-
405
-
406
- </div>
407
- </div>
408
- <div class="tags">
409
-
410
-
411
- </div><table class="source_code">
412
- <tr>
413
- <td>
414
- <pre class="lines">
415
-
416
-
417
- 3
418
- 4
419
- 5</pre>
420
- </td>
421
- <td>
422
- <pre class="code"><span class="info file"># File 'lib/schemacop/collector.rb', line 3</span>
423
-
424
- <span class='kw'>def</span> <span class='id identifier rubyid_exceptions'>exceptions</span>
425
- <span class='ivar'>@exceptions</span>
426
- <span class='kw'>end</span></pre>
427
- </td>
428
- </tr>
429
- </table>
430
- </div>
431
-
432
- </div>
433
-
434
-
435
- <div id="instance_method_details" class="method_details_list">
436
- <h2>Instance Method Details</h2>
437
-
438
-
439
- <div class="method_details first">
440
- <h3 class="signature first" id="data-instance_method">
441
-
442
- #<strong>data</strong> &#x21d2; <tt>Object</tt>
443
-
444
-
445
-
446
-
447
-
448
- </h3><table class="source_code">
449
- <tr>
450
- <td>
451
- <pre class="lines">
452
-
453
-
454
- 13
455
- 14
456
- 15
457
- 16</pre>
458
- </td>
459
- <td>
460
- <pre class="code"><span class="info file"># File 'lib/schemacop/collector.rb', line 13</span>
461
-
462
- <span class='kw'>def</span> <span class='id identifier rubyid_data'>data</span>
463
- <span class='kw'>return</span> <span class='kw'>nil</span> <span class='kw'>unless</span> <span class='id identifier rubyid_valid?'>valid?</span>
464
- <span class='ivar'>@current_datappoint_path</span><span class='period'>.</span><span class='id identifier rubyid_first'>first</span>
465
- <span class='kw'>end</span></pre>
466
- </td>
467
- </tr>
468
- </table>
469
- </div>
470
-
471
- <div class="method_details ">
472
- <h3 class="signature " id="error-instance_method">
473
-
474
- #<strong>error</strong>(error_msg) &#x21d2; <tt>Object</tt>
475
-
476
-
477
-
478
-
479
-
480
- </h3><table class="source_code">
481
- <tr>
482
- <td>
483
- <pre class="lines">
484
-
485
-
486
- 65
487
- 66
488
- 67
489
- 68
490
- 69
491
- 70</pre>
492
- </td>
493
- <td>
494
- <pre class="code"><span class="info file"># File 'lib/schemacop/collector.rb', line 65</span>
495
-
496
- <span class='kw'>def</span> <span class='id identifier rubyid_error'>error</span><span class='lparen'>(</span><span class='id identifier rubyid_error_msg'>error_msg</span><span class='rparen'>)</span>
497
- <span class='ivar'>@exceptions</span> <span class='op'>&lt;&lt;</span> <span class='lbrace'>{</span>
498
- <span class='label'>path:</span> <span class='ivar'>@current_path</span><span class='period'>.</span><span class='id identifier rubyid_dup'>dup</span><span class='comma'>,</span>
499
- <span class='label'>message:</span> <span class='id identifier rubyid_error_msg'>error_msg</span>
500
- <span class='rbrace'>}</span>
501
- <span class='kw'>end</span></pre>
502
- </td>
503
- </tr>
504
- </table>
505
- </div>
506
-
507
- <div class="method_details ">
508
- <h3 class="signature " id="exception_message-instance_method">
509
-
510
- #<strong>exception_message</strong> &#x21d2; <tt>Object</tt>
511
-
512
-
513
-
514
-
515
-
516
- </h3><table class="source_code">
517
- <tr>
518
- <td>
519
- <pre class="lines">
520
-
521
-
522
- 59
523
- 60
524
- 61
525
- 62
526
- 63</pre>
527
- </td>
528
- <td>
529
- <pre class="code"><span class="info file"># File 'lib/schemacop/collector.rb', line 59</span>
530
-
531
- <span class='kw'>def</span> <span class='id identifier rubyid_exception_message'>exception_message</span>
532
- <span class='kw'>return</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>Schemacop validation failed:\n</span><span class='tstring_end'>&quot;</span></span> <span class='op'>+</span> <span class='ivar'>@exceptions</span><span class='period'>.</span><span class='id identifier rubyid_map'>map</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id identifier rubyid_e'>e</span><span class='op'>|</span>
533
- <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>- </span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_e'>e</span><span class='lbracket'>[</span><span class='symbol'>:path</span><span class='rbracket'>]</span><span class='period'>.</span><span class='id identifier rubyid_join'>join</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_end'>&#39;</span></span><span class='rparen'>)</span><span class='embexpr_end'>}</span><span class='tstring_content'>: </span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_e'>e</span><span class='lbracket'>[</span><span class='symbol'>:message</span><span class='rbracket'>]</span><span class='embexpr_end'>}</span><span class='tstring_end'>&quot;</span></span>
534
- <span class='kw'>end</span><span class='period'>.</span><span class='id identifier rubyid_join'>join</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>\n</span><span class='tstring_end'>&quot;</span></span><span class='rparen'>)</span>
535
- <span class='kw'>end</span></pre>
536
- </td>
537
- </tr>
538
- </table>
539
- </div>
540
-
541
- <div class="method_details ">
542
- <h3 class="signature " id="ignore_next_segment-instance_method">
543
-
544
- #<strong>ignore_next_segment</strong> &#x21d2; <tt><span class='object_link'><a href="" title="Schemacop::Collector (class)">Schemacop::Collector</a></span></tt>
545
-
546
-
547
-
548
-
549
-
550
- </h3><div class="docstring">
551
- <div class="discussion">
552
- <p>Does not include the path segment next time path is
553
- called.</p>
554
-
555
-
556
- </div>
557
- </div>
558
- <div class="tags">
559
-
560
- <p class="tag_title">Returns:</p>
561
- <ul class="return">
562
-
563
- <li>
564
-
565
-
566
- <span class='type'>(<tt><span class='object_link'><a href="" title="Schemacop::Collector (class)">Schemacop::Collector</a></span></tt>)</span>
567
-
568
-
569
-
570
- </li>
571
-
572
- </ul>
573
-
574
- </div><table class="source_code">
575
- <tr>
576
- <td>
577
- <pre class="lines">
578
-
579
-
580
- 76
581
- 77
582
- 78
583
- 79</pre>
584
- </td>
585
- <td>
586
- <pre class="code"><span class="info file"># File 'lib/schemacop/collector.rb', line 76</span>
587
-
588
- <span class='kw'>def</span> <span class='id identifier rubyid_ignore_next_segment'>ignore_next_segment</span>
589
- <span class='ivar'>@ignore_next_segment</span> <span class='op'>=</span> <span class='kw'>true</span>
590
- <span class='kw'>return</span> <span class='kw'>self</span>
591
- <span class='kw'>end</span></pre>
592
- </td>
593
- </tr>
594
- </table>
595
- </div>
596
-
597
- <div class="method_details ">
598
- <h3 class="signature " id="override_value-instance_method">
599
-
600
- #<strong>override_value</strong>(value) &#x21d2; <tt>Object</tt>
601
-
602
-
603
-
604
-
605
-
606
- </h3><table class="source_code">
607
- <tr>
608
- <td>
609
- <pre class="lines">
610
-
611
-
612
- 51
613
- 52
614
- 53
615
- 54
616
- 55
617
- 56
618
- 57</pre>
619
- </td>
620
- <td>
621
- <pre class="code"><span class="info file"># File 'lib/schemacop/collector.rb', line 51</span>
622
-
623
- <span class='kw'>def</span> <span class='id identifier rubyid_override_value'>override_value</span><span class='lparen'>(</span><span class='id identifier rubyid_value'>value</span><span class='rparen'>)</span>
624
- <span class='kw'>if</span> <span class='ivar'>@current_datappoint_path</span><span class='period'>.</span><span class='id identifier rubyid_size'>size</span> <span class='op'>&gt;</span> <span class='int'>1</span>
625
- <span class='ivar'>@current_datappoint_path</span><span class='lbracket'>[</span><span class='op'>-</span><span class='int'>2</span><span class='rbracket'>]</span><span class='lbracket'>[</span><span class='ivar'>@current_index</span><span class='rbracket'>]</span> <span class='op'>=</span> <span class='id identifier rubyid_value'>value</span>
626
- <span class='kw'>else</span>
627
- <span class='ivar'>@current_datappoint_path</span><span class='lbracket'>[</span><span class='int'>0</span><span class='rbracket'>]</span> <span class='op'>=</span> <span class='id identifier rubyid_value'>value</span>
628
- <span class='kw'>end</span>
629
- <span class='kw'>end</span></pre>
630
- </td>
631
- </tr>
632
- </table>
633
- </div>
634
-
635
- <div class="method_details ">
636
- <h3 class="signature " id="path-instance_method">
637
-
638
- #<strong>path</strong>(segment, index, type) &#x21d2; <tt>Object</tt>
639
-
640
-
641
-
642
-
643
-
644
- </h3><div class="docstring">
645
- <div class="discussion">
646
- <p>Construct the current path</p>
647
-
648
-
649
- </div>
650
- </div>
651
- <div class="tags">
652
-
653
-
654
- </div><table class="source_code">
655
- <tr>
656
- <td>
657
- <pre class="lines">
658
-
659
-
660
- 23
661
- 24
662
- 25
663
- 26
664
- 27
665
- 28
666
- 29
667
- 30
668
- 31
669
- 32
670
- 33
671
- 34
672
- 35
673
- 36
674
- 37
675
- 38
676
- 39
677
- 40
678
- 41
679
- 42
680
- 43
681
- 44
682
- 45
683
- 46
684
- 47
685
- 48
686
- 49</pre>
687
- </td>
688
- <td>
689
- <pre class="code"><span class="info file"># File 'lib/schemacop/collector.rb', line 23</span>
690
-
691
- <span class='kw'>def</span> <span class='id identifier rubyid_path'>path</span><span class='lparen'>(</span><span class='id identifier rubyid_segment'>segment</span><span class='comma'>,</span> <span class='id identifier rubyid_index'>index</span><span class='comma'>,</span> <span class='id identifier rubyid_type'>type</span><span class='rparen'>)</span>
692
- <span class='id identifier rubyid_ignore_this_segment'>ignore_this_segment</span> <span class='op'>=</span> <span class='kw'>false</span>
693
-
694
- <span class='id identifier rubyid_previous_index'>previous_index</span> <span class='op'>=</span> <span class='ivar'>@current_index</span>
695
-
696
- <span class='kw'>if</span> <span class='ivar'>@ignore_next_segment</span>
697
- <span class='id identifier rubyid_ignore_this_segment'>ignore_this_segment</span> <span class='op'>=</span> <span class='kw'>true</span>
698
- <span class='ivar'>@ignore_next_segment</span> <span class='op'>=</span> <span class='kw'>false</span>
699
- <span class='kw'>else</span>
700
- <span class='kw'>unless</span> <span class='ivar'>@current_datappoint_path</span><span class='period'>.</span><span class='id identifier rubyid_last'>last</span>
701
- <span class='kw'>if</span> <span class='id identifier rubyid_type'>type</span> <span class='op'>==</span> <span class='symbol'>:hash</span>
702
- <span class='ivar'>@current_datappoint_path</span><span class='lbracket'>[</span><span class='op'>-</span><span class='int'>1</span><span class='rbracket'>]</span> <span class='op'>=</span> <span class='lbrace'>{</span><span class='rbrace'>}</span>
703
- <span class='kw'>else</span>
704
- <span class='ivar'>@current_datappoint_path</span><span class='lbracket'>[</span><span class='op'>-</span><span class='int'>1</span><span class='rbracket'>]</span> <span class='op'>=</span> <span class='lbracket'>[</span><span class='rbracket'>]</span>
705
- <span class='kw'>end</span>
706
- <span class='kw'>end</span>
707
- <span class='ivar'>@current_path</span> <span class='op'>&lt;&lt;</span> <span class='id identifier rubyid_segment'>segment</span> <span class='kw'>unless</span> <span class='id identifier rubyid_ignore_this_segment'>ignore_this_segment</span>
708
- <span class='ivar'>@current_datappoint_path</span> <span class='op'>&lt;&lt;</span> <span class='ivar'>@current_datappoint_path</span><span class='period'>.</span><span class='id identifier rubyid_last'>last</span><span class='lbracket'>[</span><span class='id identifier rubyid_index'>index</span><span class='rbracket'>]</span>
709
- <span class='ivar'>@current_index</span> <span class='op'>=</span> <span class='id identifier rubyid_index'>index</span>
710
- <span class='kw'>end</span>
711
-
712
- <span class='kw'>yield</span>
713
- <span class='kw'>ensure</span>
714
- <span class='ivar'>@current_index</span> <span class='op'>=</span> <span class='id identifier rubyid_previous_index'>previous_index</span>
715
- <span class='ivar'>@current_datappoint_path</span><span class='period'>.</span><span class='id identifier rubyid_pop'>pop</span> <span class='kw'>unless</span> <span class='id identifier rubyid_ignore_this_segment'>ignore_this_segment</span>
716
- <span class='ivar'>@current_path</span><span class='period'>.</span><span class='id identifier rubyid_pop'>pop</span> <span class='kw'>unless</span> <span class='id identifier rubyid_ignore_this_segment'>ignore_this_segment</span>
717
- <span class='kw'>end</span></pre>
718
- </td>
719
- </tr>
720
- </table>
721
- </div>
722
-
723
- <div class="method_details ">
724
- <h3 class="signature " id="valid?-instance_method">
725
-
726
- #<strong>valid?</strong> &#x21d2; <tt>Boolean</tt>
727
-
728
-
729
-
730
-
731
-
732
- </h3><div class="docstring">
733
- <div class="discussion">
734
-
735
-
736
- </div>
737
- </div>
738
- <div class="tags">
739
-
740
- <p class="tag_title">Returns:</p>
741
- <ul class="return">
742
-
743
- <li>
744
-
745
-
746
- <span class='type'>(<tt>Boolean</tt>)</span>
747
-
748
-
749
-
750
- </li>
751
-
752
- </ul>
753
-
754
- </div><table class="source_code">
755
- <tr>
756
- <td>
757
- <pre class="lines">
758
-
759
-
760
- 18
761
- 19
762
- 20</pre>
763
- </td>
764
- <td>
765
- <pre class="code"><span class="info file"># File 'lib/schemacop/collector.rb', line 18</span>
766
-
767
- <span class='kw'>def</span> <span class='id identifier rubyid_valid?'>valid?</span>
768
- <span class='ivar'>@exceptions</span><span class='period'>.</span><span class='id identifier rubyid_empty?'>empty?</span>
769
- <span class='kw'>end</span></pre>
770
- </td>
771
- </tr>
772
- </table>
773
- </div>
774
-
775
- </div>
776
-
777
- </div>
778
-
779
- <div id="footer">
780
- Generated on Mon Jun 29 17:18:17 2020 by
781
- <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
782
- 0.9.20 (ruby-2.6.2).
783
- </div>
784
-
785
- </div>
786
- </body>
787
- </html>