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
@@ -1,12 +1,12 @@
1
- <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
2
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
3
- <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
1
+ <!DOCTYPE html>
2
+ <html>
4
3
  <head>
5
- <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
4
+ <meta charset="utf-8">
5
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
6
6
  <title>
7
7
  Module: Schemacop::Exceptions
8
8
 
9
- &mdash; Documentation by YARD 0.8.7.6
9
+ &mdash; Documentation by YARD 0.9.9
10
10
 
11
11
  </title>
12
12
 
@@ -15,9 +15,8 @@
15
15
  <link rel="stylesheet" href="../css/common.css" type="text/css" charset="utf-8" />
16
16
 
17
17
  <script type="text/javascript" charset="utf-8">
18
- hasFrames = window.top.frames.main ? true : false;
18
+ pathId = "Schemacop::Exceptions";
19
19
  relpath = '../';
20
- framesUrl = "../frames.html#!Schemacop/Exceptions.html";
21
20
  </script>
22
21
 
23
22
 
@@ -28,61 +27,61 @@
28
27
 
29
28
  </head>
30
29
  <body>
31
- <div id="header">
32
- <div id="menu">
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">
33
38
 
34
39
  <a href="../_index.html">Index (E)</a> &raquo;
35
40
  <span class='title'><span class='object_link'><a href="../Schemacop.html" title="Schemacop (module)">Schemacop</a></span></span>
36
41
  &raquo;
37
42
  <span class="title">Exceptions</span>
38
43
 
39
-
40
- <div class="noframes"><span class="title">(</span><a href="." target="_top">no frames</a><span class="title">)</span></div>
41
44
  </div>
42
45
 
43
- <div id="search">
46
+ <div id="search">
44
47
 
45
48
  <a class="full_list_link" id="class_list_link"
46
49
  href="../class_list.html">
47
- Class List
48
- </a>
49
-
50
- <a class="full_list_link" id="method_list_link"
51
- href="../method_list.html">
52
- Method List
53
- </a>
54
-
55
- <a class="full_list_link" id="file_list_link"
56
- href="../file_list.html">
57
- File List
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>
58
56
  </a>
59
57
 
60
58
  </div>
61
- <div class="clear"></div>
62
- </div>
59
+ <div class="clear"></div>
60
+ </div>
63
61
 
64
- <iframe id="search_frame"></iframe>
65
-
66
- <div id="content"><h1>Module: Schemacop::Exceptions
62
+ <div id="content"><h1>Module: Schemacop::Exceptions
67
63
 
68
64
 
69
65
 
70
66
  </h1>
67
+ <div class="box_info">
68
+
71
69
 
72
- <dl class="box">
73
70
 
74
71
 
75
-
76
72
 
77
-
78
73
 
79
74
 
75
+
80
76
 
81
- <dt class="r1 last">Defined in:</dt>
82
- <dd class="r1 last">lib/schemacop/exceptions.rb</dd>
77
+
78
+
79
+ <dl>
80
+ <dt>Defined in:</dt>
81
+ <dd>lib/schemacop/exceptions.rb</dd>
82
+ </dl>
83
83
 
84
- </dl>
85
- <div class="clear"></div>
84
+ </div>
86
85
 
87
86
  <h2>Defined Under Namespace</h2>
88
87
  <p class="children">
@@ -90,7 +89,7 @@
90
89
 
91
90
 
92
91
 
93
- <strong class="classes">Classes:</strong> <span class='object_link'><a href="Exceptions/Base.html" title="Schemacop::Exceptions::Base (class)">Base</a></span>, <span class='object_link'><a href="Exceptions/InvalidSchema.html" title="Schemacop::Exceptions::InvalidSchema (class)">InvalidSchema</a></span>, <span class='object_link'><a href="Exceptions/Validation.html" title="Schemacop::Exceptions::Validation (class)">Validation</a></span>
92
+ <strong class="classes">Classes:</strong> <span class='object_link'><a href="Exceptions/InvalidSchemaError.html" title="Schemacop::Exceptions::InvalidSchemaError (class)">InvalidSchemaError</a></span>, <span class='object_link'><a href="Exceptions/ValidationError.html" title="Schemacop::Exceptions::ValidationError (class)">ValidationError</a></span>
94
93
 
95
94
 
96
95
  </p>
@@ -105,11 +104,12 @@
105
104
 
106
105
  </div>
107
106
 
108
- <div id="footer">
109
- Generated on Thu Oct 6 19:45:02 2016 by
107
+ <div id="footer">
108
+ Generated on Mon May 15 17:46:05 2017 by
110
109
  <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
111
- 0.8.7.6 (ruby-2.3.1).
110
+ 0.9.9 (ruby-2.3.1).
112
111
  </div>
113
112
 
113
+ </div>
114
114
  </body>
115
115
  </html>
@@ -0,0 +1,124 @@
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
+ Exception: Schemacop::Exceptions::InvalidSchemaError
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::Exceptions::InvalidSchemaError";
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 (I)</a> &raquo;
40
+ <span class='title'><span class='object_link'><a href="../../Schemacop.html" title="Schemacop (module)">Schemacop</a></span></span> &raquo; <span class='title'><span class='object_link'><a href="../Exceptions.html" title="Schemacop::Exceptions (module)">Exceptions</a></span></span>
41
+ &raquo;
42
+ <span class="title">InvalidSchemaError</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>Exception: Schemacop::Exceptions::InvalidSchemaError
63
+
64
+
65
+
66
+ </h1>
67
+ <div class="box_info">
68
+
69
+ <dl>
70
+ <dt>Inherits:</dt>
71
+ <dd>
72
+ <span class="inheritName">RuntimeError</span>
73
+
74
+ <ul class="fullTree">
75
+ <li>Object</li>
76
+
77
+ <li class="next">RuntimeError</li>
78
+
79
+ <li class="next">Schemacop::Exceptions::InvalidSchemaError</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/exceptions.rb</dd>
100
+ </dl>
101
+
102
+ </div>
103
+
104
+
105
+
106
+
107
+
108
+
109
+
110
+
111
+
112
+
113
+
114
+ </div>
115
+
116
+ <div id="footer">
117
+ Generated on Mon May 15 17:46:05 2017 by
118
+ <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
119
+ 0.9.9 (ruby-2.3.1).
120
+ </div>
121
+
122
+ </div>
123
+ </body>
124
+ </html>
@@ -0,0 +1,124 @@
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
+ Exception: Schemacop::Exceptions::ValidationError
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::Exceptions::ValidationError";
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 (V)</a> &raquo;
40
+ <span class='title'><span class='object_link'><a href="../../Schemacop.html" title="Schemacop (module)">Schemacop</a></span></span> &raquo; <span class='title'><span class='object_link'><a href="../Exceptions.html" title="Schemacop::Exceptions (module)">Exceptions</a></span></span>
41
+ &raquo;
42
+ <span class="title">ValidationError</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>Exception: Schemacop::Exceptions::ValidationError
63
+
64
+
65
+
66
+ </h1>
67
+ <div class="box_info">
68
+
69
+ <dl>
70
+ <dt>Inherits:</dt>
71
+ <dd>
72
+ <span class="inheritName">RuntimeError</span>
73
+
74
+ <ul class="fullTree">
75
+ <li>Object</li>
76
+
77
+ <li class="next">RuntimeError</li>
78
+
79
+ <li class="next">Schemacop::Exceptions::ValidationError</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/exceptions.rb</dd>
100
+ </dl>
101
+
102
+ </div>
103
+
104
+
105
+
106
+
107
+
108
+
109
+
110
+
111
+
112
+
113
+
114
+ </div>
115
+
116
+ <div id="footer">
117
+ Generated on Mon May 15 17:46:05 2017 by
118
+ <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
119
+ 0.9.9 (ruby-2.3.1).
120
+ </div>
121
+
122
+ </div>
123
+ </body>
124
+ </html>
@@ -0,0 +1,409 @@
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::FieldNode
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::FieldNode";
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 (F)</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">FieldNode</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::FieldNode
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="NodeSupportingType.html" title="Schemacop::NodeSupportingType (class)">NodeSupportingType</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"><span class='object_link'><a href="NodeSupportingType.html" title="Schemacop::NodeSupportingType (class)">NodeSupportingType</a></span></li>
82
+
83
+ <li class="next">Schemacop::FieldNode</li>
84
+
85
+ </ul>
86
+ <a href="#" class="inheritanceTree">show all</a>
87
+
88
+ </dd>
89
+ </dl>
90
+
91
+
92
+
93
+
94
+
95
+
96
+
97
+
98
+
99
+
100
+
101
+ <dl>
102
+ <dt>Defined in:</dt>
103
+ <dd>lib/schemacop/field_node.rb</dd>
104
+ </dl>
105
+
106
+ </div>
107
+
108
+
109
+
110
+
111
+
112
+ <h2>Instance Attribute Summary <small><a href="#" class="summary_toggle">collapse</a></small></h2>
113
+ <ul class="summary">
114
+
115
+ <li class="public ">
116
+ <span class="summary_signature">
117
+
118
+ <a href="#name-instance_method" title="#name (instance method)">#<strong>name</strong> &#x21d2; Object </a>
119
+
120
+
121
+
122
+ </span>
123
+
124
+
125
+
126
+
127
+ <span class="note title readonly">readonly</span>
128
+
129
+
130
+
131
+
132
+
133
+
134
+
135
+
136
+
137
+ <span class="summary_desc"><div class='inline'><p>Returns the value of attribute name.</p>
138
+ </div></span>
139
+
140
+ </li>
141
+
142
+
143
+ </ul>
144
+
145
+
146
+
147
+
148
+
149
+ <h3 class="inherited">Attributes inherited from <span class='object_link'><a href="Node.html" title="Schemacop::Node (class)">Node</a></span></h3>
150
+ <p class="inherited"><span class='object_link'><a href="Node.html#options-instance_method" title="Schemacop::Node#options (method)">#options</a></span></p>
151
+
152
+
153
+
154
+ <h2>
155
+ Instance Method Summary
156
+ <small><a href="#" class="summary_toggle">collapse</a></small>
157
+ </h2>
158
+
159
+ <ul class="summary">
160
+
161
+ <li class="public ">
162
+ <span class="summary_signature">
163
+
164
+ <a href="#initialize-instance_method" title="#initialize (instance method)">#<strong>initialize</strong>(name, required, options = {}, &amp;block) &#x21d2; FieldNode </a>
165
+
166
+
167
+
168
+ </span>
169
+
170
+
171
+ <span class="note title constructor">constructor</span>
172
+
173
+
174
+
175
+
176
+
177
+
178
+
179
+
180
+ <span class="summary_desc"><div class='inline'><p>A new instance of FieldNode.</p>
181
+ </div></span>
182
+
183
+ </li>
184
+
185
+
186
+ <li class="public ">
187
+ <span class="summary_signature">
188
+
189
+ <a href="#validate-instance_method" title="#validate (instance method)">#<strong>validate</strong>(data, collector) &#x21d2; Object </a>
190
+
191
+
192
+
193
+ </span>
194
+
195
+
196
+
197
+
198
+
199
+
200
+
201
+
202
+
203
+ <span class="summary_desc"><div class='inline'></div></span>
204
+
205
+ </li>
206
+
207
+
208
+ </ul>
209
+
210
+
211
+
212
+
213
+
214
+
215
+
216
+
217
+
218
+
219
+
220
+ <h3 class="inherited">Methods inherited from <span class='object_link'><a href="NodeSupportingType.html" title="Schemacop::NodeSupportingType (class)">NodeSupportingType</a></span></h3>
221
+ <p class="inherited"><span class='object_link'><a href="NodeSupportingType.html#build-class_method" title="Schemacop::NodeSupportingType.build (method)">build</a></span>, <span class='object_link'><a href="NodeSupportingType.html#exec_block-instance_method" title="Schemacop::NodeSupportingType#exec_block (method)">#exec_block</a></span>, <span class='object_link'><a href="NodeSupportingType.html#type-instance_method" title="Schemacop::NodeSupportingType#type (method)">#type</a></span></p>
222
+
223
+
224
+
225
+
226
+
227
+
228
+
229
+
230
+
231
+ <h3 class="inherited">Methods inherited from <span class='object_link'><a href="NodeWithBlock.html" title="Schemacop::NodeWithBlock (class)">NodeWithBlock</a></span></h3>
232
+ <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>
233
+
234
+
235
+
236
+
237
+
238
+
239
+
240
+
241
+
242
+ <h3 class="inherited">Methods inherited from <span class='object_link'><a href="Node.html" title="Schemacop::Node (class)">Node</a></span></h3>
243
+ <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-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></p>
244
+ <div id="constructor_details" class="method_details_list">
245
+ <h2>Constructor Details</h2>
246
+
247
+ <div class="method_details first">
248
+ <h3 class="signature first" id="initialize-instance_method">
249
+
250
+ #<strong>initialize</strong>(name, required, options = {}, &amp;block) &#x21d2; <tt><span class='object_link'><a href="" title="Schemacop::FieldNode (class)">FieldNode</a></span></tt>
251
+
252
+
253
+
254
+
255
+
256
+ </h3><div class="docstring">
257
+ <div class="discussion">
258
+ <p>Returns a new instance of FieldNode</p>
259
+
260
+
261
+ </div>
262
+ </div>
263
+ <div class="tags">
264
+
265
+
266
+ </div><table class="source_code">
267
+ <tr>
268
+ <td>
269
+ <pre class="lines">
270
+
271
+
272
+ 5
273
+ 6
274
+ 7
275
+ 8
276
+ 9
277
+ 10
278
+ 11
279
+ 12
280
+ 13
281
+ 14</pre>
282
+ </td>
283
+ <td>
284
+ <pre class="code"><span class="info file"># File 'lib/schemacop/field_node.rb', line 5</span>
285
+
286
+ <span class='kw'>def</span> <span class='id identifier rubyid_initialize'>initialize</span><span class='lparen'>(</span><span class='id identifier rubyid_name'>name</span><span class='comma'>,</span> <span class='id identifier rubyid_required'>required</span><span class='comma'>,</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>
287
+ <span class='kw'>if</span> <span class='id identifier rubyid_options'>options</span><span class='period'>.</span><span class='id identifier rubyid_any?'>any?</span>
288
+ <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 options.</span><span class='tstring_end'>&#39;</span></span>
289
+ <span class='kw'>end</span>
290
+
291
+ <span class='kw'>super</span><span class='lparen'>(</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>
292
+
293
+ <span class='ivar'>@name</span> <span class='op'>=</span> <span class='id identifier rubyid_name'>name</span>
294
+ <span class='ivar'>@required</span> <span class='op'>=</span> <span class='id identifier rubyid_required'>required</span>
295
+ <span class='kw'>end</span></pre>
296
+ </td>
297
+ </tr>
298
+ </table>
299
+ </div>
300
+
301
+ </div>
302
+
303
+ <div id="instance_attr_details" class="attr_details">
304
+ <h2>Instance Attribute Details</h2>
305
+
306
+
307
+ <span id=""></span>
308
+ <div class="method_details first">
309
+ <h3 class="signature first" id="name-instance_method">
310
+
311
+ #<strong>name</strong> &#x21d2; <tt>Object</tt> <span class="extras">(readonly)</span>
312
+
313
+
314
+
315
+
316
+
317
+ </h3><div class="docstring">
318
+ <div class="discussion">
319
+ <p>Returns the value of attribute name</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
+ 3
334
+ 4
335
+ 5</pre>
336
+ </td>
337
+ <td>
338
+ <pre class="code"><span class="info file"># File 'lib/schemacop/field_node.rb', line 3</span>
339
+
340
+ <span class='kw'>def</span> <span class='id identifier rubyid_name'>name</span>
341
+ <span class='ivar'>@name</span>
342
+ <span class='kw'>end</span></pre>
343
+ </td>
344
+ </tr>
345
+ </table>
346
+ </div>
347
+
348
+ </div>
349
+
350
+
351
+ <div id="instance_method_details" class="method_details_list">
352
+ <h2>Instance Method Details</h2>
353
+
354
+
355
+ <div class="method_details first">
356
+ <h3 class="signature first" id="validate-instance_method">
357
+
358
+ #<strong>validate</strong>(data, collector) &#x21d2; <tt>Object</tt>
359
+
360
+
361
+
362
+
363
+
364
+ </h3><table class="source_code">
365
+ <tr>
366
+ <td>
367
+ <pre class="lines">
368
+
369
+
370
+ 16
371
+ 17
372
+ 18
373
+ 19
374
+ 20
375
+ 21
376
+ 22
377
+ 23
378
+ 24</pre>
379
+ </td>
380
+ <td>
381
+ <pre class="code"><span class="info file"># File 'lib/schemacop/field_node.rb', line 16</span>
382
+
383
+ <span class='kw'>def</span> <span class='id identifier rubyid_validate'>validate</span><span class='lparen'>(</span><span class='id identifier rubyid_data'>data</span><span class='comma'>,</span> <span class='id identifier rubyid_collector'>collector</span><span class='rparen'>)</span>
384
+ <span class='kw'>unless</span> <span class='id identifier rubyid_data'>data</span><span class='period'>.</span><span class='id identifier rubyid_key?'>key?</span><span class='lparen'>(</span><span class='id identifier rubyid_name'>name</span><span class='rparen'>)</span>
385
+ <span class='id identifier rubyid_collector'>collector</span><span class='period'>.</span><span class='id identifier rubyid_error'>error</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>Missing key </span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_name'>name</span><span class='period'>.</span><span class='id identifier rubyid_inspect'>inspect</span><span class='embexpr_end'>}</span><span class='tstring_content'>.</span><span class='tstring_end'>&quot;</span></span> <span class='kw'>if</span> <span class='ivar'>@required</span>
386
+ <span class='kw'>return</span>
387
+ <span class='kw'>end</span>
388
+ <span class='id identifier rubyid_collector'>collector</span><span class='period'>.</span><span class='id identifier rubyid_path'>path</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>/</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_name'>name</span><span class='embexpr_end'>}</span><span class='tstring_end'>&quot;</span></span> <span class='kw'>do</span>
389
+ <span class='kw'>super</span><span class='lparen'>(</span><span class='id identifier rubyid_data'>data</span><span class='lbracket'>[</span><span class='id identifier rubyid_name'>name</span><span class='rbracket'>]</span><span class='comma'>,</span> <span class='id identifier rubyid_collector'>collector</span><span class='rparen'>)</span>
390
+ <span class='kw'>end</span>
391
+ <span class='kw'>end</span></pre>
392
+ </td>
393
+ </tr>
394
+ </table>
395
+ </div>
396
+
397
+ </div>
398
+
399
+ </div>
400
+
401
+ <div id="footer">
402
+ Generated on Mon May 15 17:46:05 2017 by
403
+ <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
404
+ 0.9.9 (ruby-2.3.1).
405
+ </div>
406
+
407
+ </div>
408
+ </body>
409
+ </html>