schemacop 2.4.7 → 3.0.0.rc0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (172) hide show
  1. checksums.yaml +4 -4
  2. data/.gitignore +3 -0
  3. data/.rubocop.yml +25 -1
  4. data/.travis.yml +2 -1
  5. data/CHANGELOG.md +8 -0
  6. data/README.md +41 -708
  7. data/README_V2.md +775 -0
  8. data/README_V3.md +683 -0
  9. data/Rakefile +8 -12
  10. data/VERSION +1 -1
  11. data/lib/schemacop.rb +35 -37
  12. data/lib/schemacop/base_schema.rb +37 -0
  13. data/lib/schemacop/railtie.rb +10 -0
  14. data/lib/schemacop/schema.rb +1 -60
  15. data/lib/schemacop/schema2.rb +22 -0
  16. data/lib/schemacop/schema3.rb +21 -0
  17. data/lib/schemacop/scoped_env.rb +25 -13
  18. data/lib/schemacop/v2.rb +26 -0
  19. data/lib/schemacop/{caster.rb → v2/caster.rb} +16 -2
  20. data/lib/schemacop/{collector.rb → v2/collector.rb} +5 -2
  21. data/lib/schemacop/{dupper.rb → v2/dupper.rb} +1 -1
  22. data/lib/schemacop/{field_node.rb → v2/field_node.rb} +4 -3
  23. data/lib/schemacop/v2/node.rb +142 -0
  24. data/lib/schemacop/{node_resolver.rb → v2/node_resolver.rb} +1 -1
  25. data/lib/schemacop/{node_supporting_field.rb → v2/node_supporting_field.rb} +8 -10
  26. data/lib/schemacop/{node_supporting_type.rb → v2/node_supporting_type.rb} +6 -3
  27. data/lib/schemacop/{node_with_block.rb → v2/node_with_block.rb} +3 -2
  28. data/lib/schemacop/v2/root_node.rb +6 -0
  29. data/lib/schemacop/v2/validator/array_validator.rb +32 -0
  30. data/lib/schemacop/{validator → v2/validator}/boolean_validator.rb +1 -1
  31. data/lib/schemacop/v2/validator/float_validator.rb +7 -0
  32. data/lib/schemacop/v2/validator/hash_validator.rb +37 -0
  33. data/lib/schemacop/v2/validator/integer_validator.rb +7 -0
  34. data/lib/schemacop/{validator → v2/validator}/nil_validator.rb +1 -1
  35. data/lib/schemacop/v2/validator/number_validator.rb +21 -0
  36. data/lib/schemacop/v2/validator/object_validator.rb +29 -0
  37. data/lib/schemacop/v2/validator/string_validator.rb +39 -0
  38. data/lib/schemacop/{validator → v2/validator}/symbol_validator.rb +1 -1
  39. data/lib/schemacop/v3.rb +45 -0
  40. data/lib/schemacop/v3/all_of_node.rb +27 -0
  41. data/lib/schemacop/v3/any_of_node.rb +28 -0
  42. data/lib/schemacop/v3/array_node.rb +219 -0
  43. data/lib/schemacop/v3/boolean_node.rb +16 -0
  44. data/lib/schemacop/v3/combination_node.rb +45 -0
  45. data/lib/schemacop/v3/context.rb +17 -0
  46. data/lib/schemacop/v3/dsl_scope.rb +46 -0
  47. data/lib/schemacop/v3/global_context.rb +114 -0
  48. data/lib/schemacop/v3/hash_node.rb +217 -0
  49. data/lib/schemacop/v3/integer_node.rb +13 -0
  50. data/lib/schemacop/v3/is_not_node.rb +32 -0
  51. data/lib/schemacop/v3/node.rb +214 -0
  52. data/lib/schemacop/v3/node_registry.rb +49 -0
  53. data/lib/schemacop/v3/number_node.rb +18 -0
  54. data/lib/schemacop/v3/numeric_node.rb +76 -0
  55. data/lib/schemacop/v3/object_node.rb +40 -0
  56. data/lib/schemacop/v3/one_of_node.rb +28 -0
  57. data/lib/schemacop/v3/reference_node.rb +49 -0
  58. data/lib/schemacop/v3/result.rb +58 -0
  59. data/lib/schemacop/v3/string_node.rb +124 -0
  60. data/lib/schemacop/v3/symbol_node.rb +13 -0
  61. data/schemacop.gemspec +24 -27
  62. data/test/lib/test_helper.rb +152 -0
  63. data/test/schemas/nested/group.rb +6 -0
  64. data/test/schemas/user.rb +7 -0
  65. data/test/unit/schemacop/v2/casting_test.rb +120 -0
  66. data/test/unit/schemacop/v2/collector_test.rb +47 -0
  67. data/test/unit/schemacop/v2/custom_check_test.rb +95 -0
  68. data/test/unit/schemacop/v2/custom_if_test.rb +97 -0
  69. data/test/unit/schemacop/v2/defaults_test.rb +95 -0
  70. data/test/unit/schemacop/v2/empty_test.rb +16 -0
  71. data/test/unit/schemacop/v2/nil_dis_allow_test.rb +43 -0
  72. data/test/unit/schemacop/v2/node_resolver_test.rb +28 -0
  73. data/test/unit/schemacop/v2/short_forms_test.rb +351 -0
  74. data/test/unit/schemacop/v2/types_test.rb +88 -0
  75. data/test/unit/schemacop/v2/validator_array_test.rb +99 -0
  76. data/test/unit/schemacop/v2/validator_boolean_test.rb +17 -0
  77. data/test/unit/schemacop/v2/validator_float_test.rb +59 -0
  78. data/test/unit/schemacop/v2/validator_hash_test.rb +95 -0
  79. data/test/unit/schemacop/v2/validator_integer_test.rb +48 -0
  80. data/test/unit/schemacop/v2/validator_nil_test.rb +15 -0
  81. data/test/unit/schemacop/v2/validator_number_test.rb +62 -0
  82. data/test/unit/schemacop/v2/validator_object_test.rb +141 -0
  83. data/test/unit/schemacop/v2/validator_string_test.rb +78 -0
  84. data/test/unit/schemacop/v2/validator_symbol_test.rb +18 -0
  85. data/test/unit/schemacop/v3/all_of_node_test.rb +199 -0
  86. data/test/unit/schemacop/v3/any_of_node_test.rb +218 -0
  87. data/test/unit/schemacop/v3/array_node_test.rb +805 -0
  88. data/test/unit/schemacop/v3/boolean_node_test.rb +126 -0
  89. data/test/unit/schemacop/v3/global_context_test.rb +164 -0
  90. data/test/unit/schemacop/v3/hash_node_test.rb +775 -0
  91. data/test/unit/schemacop/v3/integer_node_test.rb +323 -0
  92. data/test/unit/schemacop/v3/is_not_node_test.rb +173 -0
  93. data/test/unit/schemacop/v3/node_test.rb +148 -0
  94. data/test/unit/schemacop/v3/number_node_test.rb +292 -0
  95. data/test/unit/schemacop/v3/object_node_test.rb +170 -0
  96. data/test/unit/schemacop/v3/one_of_node_test.rb +187 -0
  97. data/test/unit/schemacop/v3/reference_node_test.rb +351 -0
  98. data/test/unit/schemacop/v3/string_node_test.rb +334 -0
  99. data/test/unit/schemacop/v3/symbol_node_test.rb +75 -0
  100. metadata +152 -145
  101. data/doc/Schemacop.html +0 -146
  102. data/doc/Schemacop/ArrayValidator.html +0 -329
  103. data/doc/Schemacop/BooleanValidator.html +0 -145
  104. data/doc/Schemacop/Caster.html +0 -379
  105. data/doc/Schemacop/Collector.html +0 -787
  106. data/doc/Schemacop/Dupper.html +0 -214
  107. data/doc/Schemacop/Exceptions.html +0 -115
  108. data/doc/Schemacop/Exceptions/InvalidSchemaError.html +0 -124
  109. data/doc/Schemacop/Exceptions/ValidationError.html +0 -124
  110. data/doc/Schemacop/FieldNode.html +0 -421
  111. data/doc/Schemacop/FloatValidator.html +0 -158
  112. data/doc/Schemacop/HashValidator.html +0 -293
  113. data/doc/Schemacop/IntegerValidator.html +0 -158
  114. data/doc/Schemacop/NilValidator.html +0 -145
  115. data/doc/Schemacop/Node.html +0 -1438
  116. data/doc/Schemacop/NodeResolver.html +0 -258
  117. data/doc/Schemacop/NodeSupportingField.html +0 -590
  118. data/doc/Schemacop/NodeSupportingType.html +0 -612
  119. data/doc/Schemacop/NodeWithBlock.html +0 -289
  120. data/doc/Schemacop/NumberValidator.html +0 -232
  121. data/doc/Schemacop/ObjectValidator.html +0 -298
  122. data/doc/Schemacop/RootNode.html +0 -171
  123. data/doc/Schemacop/Schema.html +0 -699
  124. data/doc/Schemacop/StringValidator.html +0 -295
  125. data/doc/Schemacop/SymbolValidator.html +0 -145
  126. data/doc/ScopedEnv.html +0 -351
  127. data/doc/_index.html +0 -379
  128. data/doc/class_list.html +0 -51
  129. data/doc/css/common.css +0 -1
  130. data/doc/css/full_list.css +0 -58
  131. data/doc/css/style.css +0 -496
  132. data/doc/file.README.html +0 -833
  133. data/doc/file_list.html +0 -56
  134. data/doc/frames.html +0 -17
  135. data/doc/index.html +0 -833
  136. data/doc/inheritance.graphml +0 -524
  137. data/doc/inheritance.pdf +0 -825
  138. data/doc/js/app.js +0 -303
  139. data/doc/js/full_list.js +0 -216
  140. data/doc/js/jquery.js +0 -4
  141. data/doc/method_list.html +0 -587
  142. data/doc/top-level-namespace.html +0 -112
  143. data/lib/schemacop/node.rb +0 -139
  144. data/lib/schemacop/root_node.rb +0 -4
  145. data/lib/schemacop/validator/array_validator.rb +0 -30
  146. data/lib/schemacop/validator/float_validator.rb +0 -5
  147. data/lib/schemacop/validator/hash_validator.rb +0 -35
  148. data/lib/schemacop/validator/integer_validator.rb +0 -5
  149. data/lib/schemacop/validator/number_validator.rb +0 -19
  150. data/lib/schemacop/validator/object_validator.rb +0 -27
  151. data/lib/schemacop/validator/string_validator.rb +0 -37
  152. data/test/casting_test.rb +0 -118
  153. data/test/collector_test.rb +0 -45
  154. data/test/custom_check_test.rb +0 -93
  155. data/test/custom_if_test.rb +0 -95
  156. data/test/defaults_test.rb +0 -93
  157. data/test/empty_test.rb +0 -14
  158. data/test/nil_dis_allow_test.rb +0 -41
  159. data/test/node_resolver_test.rb +0 -26
  160. data/test/short_forms_test.rb +0 -349
  161. data/test/test_helper.rb +0 -13
  162. data/test/types_test.rb +0 -84
  163. data/test/validator_array_test.rb +0 -97
  164. data/test/validator_boolean_test.rb +0 -15
  165. data/test/validator_float_test.rb +0 -57
  166. data/test/validator_hash_test.rb +0 -93
  167. data/test/validator_integer_test.rb +0 -46
  168. data/test/validator_nil_test.rb +0 -13
  169. data/test/validator_number_test.rb +0 -60
  170. data/test/validator_object_test.rb +0 -139
  171. data/test/validator_string_test.rb +0 -76
  172. data/test/validator_symbol_test.rb +0 -16
@@ -1,258 +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::NodeResolver
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::NodeResolver";
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">NodeResolver</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::NodeResolver
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::NodeResolver</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_resolver.rb</dd>
98
- </dl>
99
-
100
- </div>
101
-
102
-
103
-
104
-
105
-
106
-
107
-
108
-
109
-
110
- <h2>
111
- Class Method Summary
112
- <small><a href="#" class="summary_toggle">collapse</a></small>
113
- </h2>
114
-
115
- <ul class="summary">
116
-
117
- <li class="public ">
118
- <span class="summary_signature">
119
-
120
- <a href="#register-class_method" title="register (class method)">.<strong>register</strong>(node_class, before: nil) &#x21d2; Object </a>
121
-
122
-
123
-
124
- </span>
125
-
126
-
127
-
128
-
129
-
130
-
131
-
132
-
133
-
134
- <span class="summary_desc"><div class='inline'></div></span>
135
-
136
- </li>
137
-
138
-
139
- <li class="public ">
140
- <span class="summary_signature">
141
-
142
- <a href="#resolve-class_method" title="resolve (class method)">.<strong>resolve</strong>(type) &#x21d2; Object </a>
143
-
144
-
145
-
146
- </span>
147
-
148
-
149
-
150
-
151
-
152
-
153
-
154
-
155
-
156
- <span class="summary_desc"><div class='inline'></div></span>
157
-
158
- </li>
159
-
160
-
161
- </ul>
162
-
163
-
164
-
165
-
166
- <div id="class_method_details" class="method_details_list">
167
- <h2>Class Method Details</h2>
168
-
169
-
170
- <div class="method_details first">
171
- <h3 class="signature first" id="register-class_method">
172
-
173
- .<strong>register</strong>(node_class, before: nil) &#x21d2; <tt>Object</tt>
174
-
175
-
176
-
177
-
178
-
179
- </h3><table class="source_code">
180
- <tr>
181
- <td>
182
- <pre class="lines">
183
-
184
-
185
- 6
186
- 7
187
- 8
188
- 9
189
- 10
190
- 11
191
- 12
192
- 13
193
- 14
194
- 15
195
- 16</pre>
196
- </td>
197
- <td>
198
- <pre class="code"><span class="info file"># File 'lib/schemacop/node_resolver.rb', line 6</span>
199
-
200
- <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='id identifier rubyid_node_class'>node_class</span><span class='comma'>,</span> <span class='label'>before:</span> <span class='kw'>nil</span><span class='rparen'>)</span>
201
- <span class='kw'>if</span> <span class='id identifier rubyid_before'>before</span>
202
- <span class='kw'>unless</span> <span class='lparen'>(</span><span class='id identifier rubyid_index'>index</span> <span class='op'>=</span> <span class='id identifier rubyid_node_classes'>node_classes</span><span class='period'>.</span><span class='id identifier rubyid_find_index'>find_index</span><span class='lparen'>(</span><span class='id identifier rubyid_before'>before</span><span class='rparen'>)</span><span class='rparen'>)</span>
203
- <span class='id identifier rubyid_fail'>fail</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>Cannot insert before class </span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_before'>before</span><span class='embexpr_end'>}</span><span class='tstring_content'> which has not been registered yet.</span><span class='tstring_end'>&quot;</span></span>
204
- <span class='kw'>end</span>
205
-
206
- <span class='id identifier rubyid_node_classes'>node_classes</span><span class='period'>.</span><span class='id identifier rubyid_insert'>insert</span><span class='lparen'>(</span><span class='id identifier rubyid_index'>index</span><span class='comma'>,</span> <span class='id identifier rubyid_node_class'>node_class</span><span class='rparen'>)</span>
207
- <span class='kw'>else</span>
208
- <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_node_classes'>node_classes</span> <span class='op'>+=</span> <span class='lbracket'>[</span><span class='id identifier rubyid_node_class'>node_class</span><span class='rbracket'>]</span>
209
- <span class='kw'>end</span>
210
- <span class='kw'>end</span></pre>
211
- </td>
212
- </tr>
213
- </table>
214
- </div>
215
-
216
- <div class="method_details ">
217
- <h3 class="signature " id="resolve-class_method">
218
-
219
- .<strong>resolve</strong>(type) &#x21d2; <tt>Object</tt>
220
-
221
-
222
-
223
-
224
-
225
- </h3><table class="source_code">
226
- <tr>
227
- <td>
228
- <pre class="lines">
229
-
230
-
231
- 18
232
- 19
233
- 20</pre>
234
- </td>
235
- <td>
236
- <pre class="code"><span class="info file"># File 'lib/schemacop/node_resolver.rb', line 18</span>
237
-
238
- <span class='kw'>def</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_resolve'>resolve</span><span class='lparen'>(</span><span class='id identifier rubyid_type'>type</span><span class='rparen'>)</span>
239
- <span class='id identifier rubyid_node_classes'>node_classes</span><span class='period'>.</span><span class='id identifier rubyid_find'>find</span> <span class='lbrace'>{</span> <span class='op'>|</span><span class='id identifier rubyid_c'>c</span><span class='op'>|</span> <span class='id identifier rubyid_c'>c</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> <span class='rbrace'>}</span>
240
- <span class='kw'>end</span></pre>
241
- </td>
242
- </tr>
243
- </table>
244
- </div>
245
-
246
- </div>
247
-
248
- </div>
249
-
250
- <div id="footer">
251
- Generated on Thu Jul 2 11:30:34 2020 by
252
- <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
253
- 0.9.20 (ruby-2.6.2).
254
- </div>
255
-
256
- </div>
257
- </body>
258
- </html>
@@ -1,590 +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::NodeSupportingField
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::NodeSupportingField";
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">NodeSupportingField</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::NodeSupportingField
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="NodeWithBlock.html" title="Schemacop::NodeWithBlock (class)">NodeWithBlock</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"><span class='object_link'><a href="NodeWithBlock.html" title="Schemacop::NodeWithBlock (class)">NodeWithBlock</a></span></li>
80
-
81
- <li class="next">Schemacop::NodeSupportingField</li>
82
-
83
- </ul>
84
- <a href="#" class="inheritanceTree">show all</a>
85
-
86
- </dd>
87
- </dl>
88
-
89
-
90
-
91
-
92
-
93
-
94
-
95
-
96
-
97
-
98
-
99
- <dl>
100
- <dt>Defined in:</dt>
101
- <dd>lib/schemacop/node_supporting_field.rb</dd>
102
- </dl>
103
-
104
- </div>
105
-
106
- <div id="subclasses">
107
- <h2>Direct Known Subclasses</h2>
108
- <p class="children"><span class='object_link'><a href="HashValidator.html" title="Schemacop::HashValidator (class)">HashValidator</a></span></p>
109
- </div>
110
-
111
-
112
-
113
-
114
- <h2>Instance Attribute Summary <small><a href="#" class="summary_toggle">collapse</a></small></h2>
115
- <ul class="summary">
116
-
117
- <li class="public ">
118
- <span class="summary_signature">
119
-
120
- <a href="#fields-instance_method" title="#fields (instance method)">#<strong>fields</strong> &#x21d2; Object </a>
121
-
122
-
123
-
124
- </span>
125
-
126
-
127
-
128
-
129
- <span class="note title readonly">readonly</span>
130
-
131
-
132
-
133
-
134
-
135
-
136
-
137
-
138
-
139
- <span class="summary_desc"><div class='inline'><p>Returns the value of attribute fields.</p>
140
- </div></span>
141
-
142
- </li>
143
-
144
-
145
- </ul>
146
-
147
-
148
-
149
-
150
-
151
- <h3 class="inherited">Attributes inherited from <span class='object_link'><a href="Node.html" title="Schemacop::Node (class)">Node</a></span></h3>
152
- <p class="inherited"><span class='object_link'><a href="Node.html#options-instance_method" title="Schemacop::Node#options (method)">#options</a></span></p>
153
-
154
-
155
-
156
- <h2>
157
- Instance Method Summary
158
- <small><a href="#" class="summary_toggle">collapse</a></small>
159
- </h2>
160
-
161
- <ul class="summary">
162
-
163
- <li class="public ">
164
- <span class="summary_signature">
165
-
166
- <a href="#initialize-instance_method" title="#initialize (instance method)">#<strong>initialize</strong>(options = {}, &amp;block) &#x21d2; NodeSupportingField </a>
167
-
168
-
169
-
170
- </span>
171
-
172
-
173
- <span class="note title constructor">constructor</span>
174
-
175
-
176
-
177
-
178
-
179
-
180
-
181
-
182
- <span class="summary_desc"><div class='inline'><p>A new instance of NodeSupportingField.</p>
183
- </div></span>
184
-
185
- </li>
186
-
187
-
188
- <li class="public ">
189
- <span class="summary_signature">
190
-
191
- <a href="#opt!-instance_method" title="#opt! (instance method)">#<strong>opt!</strong>(*args, &amp;block) &#x21d2; Object </a>
192
-
193
-
194
-
195
- </span>
196
-
197
-
198
-
199
-
200
-
201
-
202
-
203
-
204
-
205
- <span class="summary_desc"><div class='inline'></div></span>
206
-
207
- </li>
208
-
209
-
210
- <li class="public ">
211
- <span class="summary_signature">
212
-
213
- <a href="#opt%3F-instance_method" title="#opt? (instance method)">#<strong>opt?</strong>(*args, &amp;block) &#x21d2; Boolean </a>
214
-
215
-
216
-
217
- (also: #opt)
218
-
219
- </span>
220
-
221
-
222
-
223
-
224
-
225
-
226
-
227
-
228
-
229
- <span class="summary_desc"><div class='inline'></div></span>
230
-
231
- </li>
232
-
233
-
234
- <li class="public ">
235
- <span class="summary_signature">
236
-
237
- <a href="#req!-instance_method" title="#req! (instance method)">#<strong>req!</strong>(*args, &amp;block) &#x21d2; Object </a>
238
-
239
-
240
-
241
- (also: #req)
242
-
243
- </span>
244
-
245
-
246
-
247
-
248
-
249
-
250
-
251
-
252
-
253
- <span class="summary_desc"><div class='inline'></div></span>
254
-
255
- </li>
256
-
257
-
258
- <li class="public ">
259
- <span class="summary_signature">
260
-
261
- <a href="#req%3F-instance_method" title="#req? (instance method)">#<strong>req?</strong>(*args, &amp;block) &#x21d2; Boolean </a>
262
-
263
-
264
-
265
- </span>
266
-
267
-
268
-
269
-
270
-
271
-
272
-
273
-
274
-
275
- <span class="summary_desc"><div class='inline'></div></span>
276
-
277
- </li>
278
-
279
-
280
- </ul>
281
-
282
-
283
-
284
-
285
-
286
-
287
-
288
-
289
-
290
-
291
-
292
- <h3 class="inherited">Methods inherited from <span class='object_link'><a href="NodeWithBlock.html" title="Schemacop::NodeWithBlock (class)">NodeWithBlock</a></span></h3>
293
- <p class="inherited"><span class='object_link'><a href="NodeWithBlock.html#block_method-class_method" title="Schemacop::NodeWithBlock.block_method (method)">block_method</a></span>, <span class='object_link'><a href="NodeWithBlock.html#exec_block-instance_method" title="Schemacop::NodeWithBlock#exec_block (method)">#exec_block</a></span></p>
294
-
295
-
296
-
297
-
298
-
299
-
300
-
301
-
302
-
303
- <h3 class="inherited">Methods inherited from <span class='object_link'><a href="Node.html" title="Schemacop::Node (class)">Node</a></span></h3>
304
- <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#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>
305
- <div id="constructor_details" class="method_details_list">
306
- <h2>Constructor Details</h2>
307
-
308
- <div class="method_details first">
309
- <h3 class="signature first" id="initialize-instance_method">
310
-
311
- #<strong>initialize</strong>(options = {}, &amp;block) &#x21d2; <tt><span class='object_link'><a href="" title="Schemacop::NodeSupportingField (class)">NodeSupportingField</a></span></tt>
312
-
313
-
314
-
315
-
316
-
317
- </h3><div class="docstring">
318
- <div class="discussion">
319
- <p>Returns a new instance of NodeSupportingField</p>
320
-
321
-
322
- </div>
323
- </div>
324
- <div class="tags">
325
-
326
-
327
- </div><table class="source_code">
328
- <tr>
329
- <td>
330
- <pre class="lines">
331
-
332
-
333
- 12
334
- 13
335
- 14
336
- 15
337
- 16</pre>
338
- </td>
339
- <td>
340
- <pre class="code"><span class="info file"># File 'lib/schemacop/node_supporting_field.rb', line 12</span>
341
-
342
- <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='comma'>,</span> <span class='op'>&amp;</span><span class='id identifier rubyid_block'>block</span><span class='rparen'>)</span>
343
- <span class='ivar'>@fields</span> <span class='op'>=</span> <span class='lbrace'>{</span><span class='rbrace'>}</span>
344
- <span class='kw'>super</span>
345
- <span class='id identifier rubyid_exec_block'>exec_block</span><span class='lparen'>(</span><span class='op'>&amp;</span><span class='id identifier rubyid_block'>block</span><span class='rparen'>)</span>
346
- <span class='kw'>end</span></pre>
347
- </td>
348
- </tr>
349
- </table>
350
- </div>
351
-
352
- </div>
353
-
354
- <div id="instance_attr_details" class="attr_details">
355
- <h2>Instance Attribute Details</h2>
356
-
357
-
358
- <span id=""></span>
359
- <div class="method_details first">
360
- <h3 class="signature first" id="fields-instance_method">
361
-
362
- #<strong>fields</strong> &#x21d2; <tt>Object</tt> <span class="extras">(readonly)</span>
363
-
364
-
365
-
366
-
367
-
368
- </h3><div class="docstring">
369
- <div class="discussion">
370
- <p>Returns the value of attribute fields</p>
371
-
372
-
373
- </div>
374
- </div>
375
- <div class="tags">
376
-
377
-
378
- </div><table class="source_code">
379
- <tr>
380
- <td>
381
- <pre class="lines">
382
-
383
-
384
- 10
385
- 11
386
- 12</pre>
387
- </td>
388
- <td>
389
- <pre class="code"><span class="info file"># File 'lib/schemacop/node_supporting_field.rb', line 10</span>
390
-
391
- <span class='kw'>def</span> <span class='id identifier rubyid_fields'>fields</span>
392
- <span class='ivar'>@fields</span>
393
- <span class='kw'>end</span></pre>
394
- </td>
395
- </tr>
396
- </table>
397
- </div>
398
-
399
- </div>
400
-
401
-
402
- <div id="instance_method_details" class="method_details_list">
403
- <h2>Instance Method Details</h2>
404
-
405
-
406
- <div class="method_details first">
407
- <h3 class="signature first" id="opt!-instance_method">
408
-
409
- #<strong>opt!</strong>(*args, &amp;block) &#x21d2; <tt>Object</tt>
410
-
411
-
412
-
413
-
414
-
415
- </h3><table class="source_code">
416
- <tr>
417
- <td>
418
- <pre class="lines">
419
-
420
-
421
- 32
422
- 33
423
- 34</pre>
424
- </td>
425
- <td>
426
- <pre class="code"><span class="info file"># File 'lib/schemacop/node_supporting_field.rb', line 32</span>
427
-
428
- <span class='kw'>def</span> <span class='id identifier rubyid_opt!'>opt!</span><span class='lparen'>(</span><span class='op'>*</span><span class='id identifier rubyid_args'>args</span><span class='comma'>,</span> <span class='op'>&amp;</span><span class='id identifier rubyid_block'>block</span><span class='rparen'>)</span>
429
- <span class='id identifier rubyid_field'>field</span><span class='lparen'>(</span><span class='op'>*</span><span class='id identifier rubyid_args'>args</span><span class='comma'>,</span> <span class='label'>required:</span> <span class='kw'>false</span><span class='comma'>,</span> <span class='label'>allow_nil:</span> <span class='kw'>false</span><span class='comma'>,</span> <span class='op'>&amp;</span><span class='id identifier rubyid_block'>block</span><span class='rparen'>)</span>
430
- <span class='kw'>end</span></pre>
431
- </td>
432
- </tr>
433
- </table>
434
- </div>
435
-
436
- <div class="method_details ">
437
- <h3 class="signature " id="opt?-instance_method">
438
-
439
- #<strong>opt?</strong>(*args, &amp;block) &#x21d2; <tt>Boolean</tt>
440
-
441
-
442
-
443
- <span class="aliases">Also known as:
444
- <span class="names"><span id='opt-instance_method'>opt</span></span>
445
- </span>
446
-
447
-
448
-
449
- </h3><div class="docstring">
450
- <div class="discussion">
451
-
452
-
453
- </div>
454
- </div>
455
- <div class="tags">
456
-
457
- <p class="tag_title">Returns:</p>
458
- <ul class="return">
459
-
460
- <li>
461
-
462
-
463
- <span class='type'>(<tt>Boolean</tt>)</span>
464
-
465
-
466
-
467
- </li>
468
-
469
- </ul>
470
-
471
- </div><table class="source_code">
472
- <tr>
473
- <td>
474
- <pre class="lines">
475
-
476
-
477
- 28
478
- 29
479
- 30</pre>
480
- </td>
481
- <td>
482
- <pre class="code"><span class="info file"># File 'lib/schemacop/node_supporting_field.rb', line 28</span>
483
-
484
- <span class='kw'>def</span> <span class='id identifier rubyid_opt?'>opt?</span><span class='lparen'>(</span><span class='op'>*</span><span class='id identifier rubyid_args'>args</span><span class='comma'>,</span> <span class='op'>&amp;</span><span class='id identifier rubyid_block'>block</span><span class='rparen'>)</span>
485
- <span class='id identifier rubyid_field'>field</span><span class='lparen'>(</span><span class='op'>*</span><span class='id identifier rubyid_args'>args</span><span class='comma'>,</span> <span class='label'>required:</span> <span class='kw'>false</span><span class='comma'>,</span> <span class='label'>allow_nil:</span> <span class='kw'>true</span><span class='comma'>,</span> <span class='op'>&amp;</span><span class='id identifier rubyid_block'>block</span><span class='rparen'>)</span>
486
- <span class='kw'>end</span></pre>
487
- </td>
488
- </tr>
489
- </table>
490
- </div>
491
-
492
- <div class="method_details ">
493
- <h3 class="signature " id="req!-instance_method">
494
-
495
- #<strong>req!</strong>(*args, &amp;block) &#x21d2; <tt>Object</tt>
496
-
497
-
498
-
499
- <span class="aliases">Also known as:
500
- <span class="names"><span id='req-instance_method'>req</span></span>
501
- </span>
502
-
503
-
504
-
505
- </h3><table class="source_code">
506
- <tr>
507
- <td>
508
- <pre class="lines">
509
-
510
-
511
- 22
512
- 23
513
- 24</pre>
514
- </td>
515
- <td>
516
- <pre class="code"><span class="info file"># File 'lib/schemacop/node_supporting_field.rb', line 22</span>
517
-
518
- <span class='kw'>def</span> <span class='id identifier rubyid_req!'>req!</span><span class='lparen'>(</span><span class='op'>*</span><span class='id identifier rubyid_args'>args</span><span class='comma'>,</span> <span class='op'>&amp;</span><span class='id identifier rubyid_block'>block</span><span class='rparen'>)</span>
519
- <span class='id identifier rubyid_field'>field</span><span class='lparen'>(</span><span class='op'>*</span><span class='id identifier rubyid_args'>args</span><span class='comma'>,</span> <span class='label'>required:</span> <span class='kw'>true</span><span class='comma'>,</span> <span class='label'>allow_nil:</span> <span class='kw'>false</span><span class='comma'>,</span> <span class='op'>&amp;</span><span class='id identifier rubyid_block'>block</span><span class='rparen'>)</span>
520
- <span class='kw'>end</span></pre>
521
- </td>
522
- </tr>
523
- </table>
524
- </div>
525
-
526
- <div class="method_details ">
527
- <h3 class="signature " id="req?-instance_method">
528
-
529
- #<strong>req?</strong>(*args, &amp;block) &#x21d2; <tt>Boolean</tt>
530
-
531
-
532
-
533
-
534
-
535
- </h3><div class="docstring">
536
- <div class="discussion">
537
-
538
-
539
- </div>
540
- </div>
541
- <div class="tags">
542
-
543
- <p class="tag_title">Returns:</p>
544
- <ul class="return">
545
-
546
- <li>
547
-
548
-
549
- <span class='type'>(<tt>Boolean</tt>)</span>
550
-
551
-
552
-
553
- </li>
554
-
555
- </ul>
556
-
557
- </div><table class="source_code">
558
- <tr>
559
- <td>
560
- <pre class="lines">
561
-
562
-
563
- 18
564
- 19
565
- 20</pre>
566
- </td>
567
- <td>
568
- <pre class="code"><span class="info file"># File 'lib/schemacop/node_supporting_field.rb', line 18</span>
569
-
570
- <span class='kw'>def</span> <span class='id identifier rubyid_req?'>req?</span><span class='lparen'>(</span><span class='op'>*</span><span class='id identifier rubyid_args'>args</span><span class='comma'>,</span> <span class='op'>&amp;</span><span class='id identifier rubyid_block'>block</span><span class='rparen'>)</span>
571
- <span class='id identifier rubyid_field'>field</span><span class='lparen'>(</span><span class='op'>*</span><span class='id identifier rubyid_args'>args</span><span class='comma'>,</span> <span class='label'>required:</span> <span class='kw'>true</span><span class='comma'>,</span> <span class='label'>allow_nil:</span> <span class='kw'>true</span><span class='comma'>,</span> <span class='op'>&amp;</span><span class='id identifier rubyid_block'>block</span><span class='rparen'>)</span>
572
- <span class='kw'>end</span></pre>
573
- </td>
574
- </tr>
575
- </table>
576
- </div>
577
-
578
- </div>
579
-
580
- </div>
581
-
582
- <div id="footer">
583
- Generated on Thu Jul 2 11:30:34 2020 by
584
- <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
585
- 0.9.20 (ruby-2.6.2).
586
- </div>
587
-
588
- </div>
589
- </body>
590
- </html>