schemacop 2.4.1 → 2.4.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (52) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +26 -0
  3. data/LICENSE +1 -1
  4. data/README.md +18 -11
  5. data/VERSION +1 -1
  6. data/doc/Schemacop.html +4 -4
  7. data/doc/Schemacop/ArrayValidator.html +1 -1
  8. data/doc/Schemacop/BooleanValidator.html +1 -1
  9. data/doc/Schemacop/Caster.html +1 -1
  10. data/doc/Schemacop/Collector.html +1 -1
  11. data/doc/Schemacop/Dupper.html +214 -0
  12. data/doc/Schemacop/Exceptions.html +1 -1
  13. data/doc/Schemacop/Exceptions/InvalidSchemaError.html +1 -1
  14. data/doc/Schemacop/Exceptions/ValidationError.html +1 -1
  15. data/doc/Schemacop/FieldNode.html +1 -1
  16. data/doc/Schemacop/FloatValidator.html +1 -1
  17. data/doc/Schemacop/HashValidator.html +10 -6
  18. data/doc/Schemacop/IntegerValidator.html +1 -1
  19. data/doc/Schemacop/NilValidator.html +1 -1
  20. data/doc/Schemacop/Node.html +1 -1
  21. data/doc/Schemacop/NodeResolver.html +1 -1
  22. data/doc/Schemacop/NodeSupportingField.html +1 -1
  23. data/doc/Schemacop/NodeSupportingType.html +1 -1
  24. data/doc/Schemacop/NodeWithBlock.html +1 -1
  25. data/doc/Schemacop/NumberValidator.html +1 -1
  26. data/doc/Schemacop/ObjectValidator.html +1 -1
  27. data/doc/Schemacop/RootNode.html +1 -1
  28. data/doc/Schemacop/Schema.html +8 -6
  29. data/doc/Schemacop/StringValidator.html +1 -1
  30. data/doc/Schemacop/SymbolValidator.html +1 -1
  31. data/doc/ScopedEnv.html +1 -1
  32. data/doc/_index.html +19 -4
  33. data/doc/class_list.html +1 -1
  34. data/doc/file.README.html +19 -12
  35. data/doc/index.html +19 -12
  36. data/doc/method_list.html +93 -85
  37. data/doc/top-level-namespace.html +1 -1
  38. data/lib/schemacop.rb +2 -2
  39. data/lib/schemacop/dupper.rb +19 -0
  40. data/lib/schemacop/field_node.rb +1 -0
  41. data/lib/schemacop/node_supporting_type.rb +6 -6
  42. data/lib/schemacop/schema.rb +2 -1
  43. data/lib/schemacop/validator/hash_validator.rb +5 -1
  44. data/lib/schemacop/validator/object_validator.rb +1 -1
  45. data/schemacop.gemspec +5 -5
  46. data/test/casting_test.rb +10 -0
  47. data/test/defaults_test.rb +22 -0
  48. data/test/empty_test.rb +14 -0
  49. data/test/short_forms_test.rb +11 -0
  50. data/test/validator_hash_test.rb +22 -0
  51. data/test/validator_object_test.rb +34 -0
  52. metadata +7 -3
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: ecc0bb69ecb7c86b6c507928ff2568a3fc0e5a5927d414eaf34a3817accbcd1b
4
- data.tar.gz: fbe0e82379f5f330b60a71717ebcefa4bd1280c59a61e7de8e4ccfad137852c2
3
+ metadata.gz: 20424213f11e658be2843c1de6fb401282366aacaaeaabc44ea59a5702450c0a
4
+ data.tar.gz: 324b171945481c70eaf990fc2bd415924006580452adf401dbd4cb31be64f246
5
5
  SHA512:
6
- metadata.gz: c6406092916323732d4b99972bd77e5ab87b6cc45331dce34d72f0f666bdb6a526b35df900a393bf0c2e6164771f91509c42d97b29a7f0a9f60d75b0ca1a25b9
7
- data.tar.gz: f30be0a5a40a75812b8f75a2d298019bbd99022479261365210933b1038768512da1f03925d930e9fe80696a104da98c5f826e83b7fad2140cb4b0781b9d201d
6
+ metadata.gz: 8074c7fa98e9a20ceb7215299a11383653130f646a9373a9e9bdf5cc1278b0367820196f78a510b209dd8da72315b888ed3bace7aad3e84149a2732e91de5889
7
+ data.tar.gz: 28760f0e430a1c593762e25f3884a6b35761190420bf4e9f40584adb18dff4f4a45521e624e2918f40040805c2f52d74ba9ffd82c5af0ea4382f7f90196488a0
@@ -10,6 +10,32 @@
10
10
  ### Changes
11
11
  -->
12
12
 
13
+ ## 2.4.6 (2020-06-29)
14
+
15
+ * Use basis 10 (decimal system) when casting a `String` to an `Integer`
16
+
17
+ ## 2.4.5 (2020-05-13)
18
+
19
+ * Allow procs for `default` that will be evaluated at runtime
20
+
21
+ ## 2.4.4 (2020-03-9)
22
+
23
+ * Add option `allow_obsolete_keys` to `:hash` validator in order to allow
24
+ validating arbitrary hashes with dynamic keys not specifiable in schema.
25
+
26
+ ## 2.4.3 (2020-03-05)
27
+
28
+ * Only dup hashes and arrays but not the values when creating the modified
29
+ datastructure that is returned by `validate!`.
30
+
31
+ ## 2.4.2 (2019-11-05)
32
+
33
+ ### Bug fixes
34
+
35
+ * The object validator, if given no classes, now supports any object of classes
36
+ that derive from `BasicObject`. This allows you to specify types that reside
37
+ out of the ruby standard library, such as `Tempfile`.
38
+
13
39
  ## 2.4.1 (2019-10-28)
14
40
 
15
41
  ### Bug fixes
data/LICENSE CHANGED
@@ -1,6 +1,6 @@
1
1
  The MIT License (MIT)
2
2
 
3
- Copyright (c) 2019 Sitrox
3
+ Copyright (c) 2020 Sitrox
4
4
 
5
5
  Permission is hereby granted, free of charge, to any person obtaining a copy
6
6
  of this software and associated documentation files (the "Software"), to deal
data/README.md CHANGED
@@ -395,6 +395,10 @@ The following types are supported by Schemacop by default:
395
395
 
396
396
  - accepts a block with an arbitrary number of Field Lines.
397
397
 
398
+ - `allow_obsolete_keys`: If enabled (default `false`), this allows arbitrary
399
+ keys within your hash. Keys not specified in your schema will not be
400
+ validated further, but keys specified explicitly are still validated.
401
+
398
402
  * `:nil`: accepts a Ruby NilClass instance. If you want to allow `nil` as a
399
403
  value in a field, see above for the usage of the suffixes `-!` and `-?` for
400
404
  Field Lines.
@@ -623,6 +627,18 @@ Schema.new do
623
627
  req :foo
624
628
  end
625
629
  end
630
+
631
+ # You can also specify blocks (without params) as defaults that will be
632
+ # evaluated at time of validation.
633
+ Schema.new do
634
+ opt :year, :integer, default: ->() { Time.now.year }
635
+ end
636
+
637
+ # If, for some very specific reason, you *need* the default to be an actual
638
+ # proc, wrap it inside another proc.
639
+ Schema.new do
640
+ opt :myproc, Proc, default: ->() { ->() { 42 } }
641
+ end
626
642
  ```
627
643
 
628
644
  ### Required data points
@@ -668,7 +684,7 @@ Example:
668
684
  Schema.new do
669
685
  # Pass array to `cast`. This enables casting from String or Float to Integer
670
686
  # using the built-in casters.
671
- req: id_1, :integer, cast: [String, Float]
687
+ req :id_1, :integer, cast: [String, Float]
672
688
 
673
689
  # Pass hash to `cast`. This enables casting from Float to Integer using the
674
690
  # built-in caster and from String to Integer using a custom callback.
@@ -739,9 +755,6 @@ Schemacop will throw one of the following checked exceptions:
739
755
 
740
756
  * Schemacop does not yet allow cyclic structures with infinite depth.
741
757
 
742
- * Schemacop aborts when it encounters an error. It is not able to collect a full
743
- list of multiple errors.
744
-
745
758
  * Schemacop is not made for validating complex causalities (i.e. field `a`
746
759
  needs to be given only if field `b` is present).
747
760
 
@@ -760,12 +773,6 @@ To run tests:
760
773
  * Run `bundle exec rake test TEST=test/unit/some/file.rb` to run a single test
761
774
  file
762
775
 
763
- ## Contributors
764
-
765
- Thanks to [Rubocop](https://github.com/bbatsov/rubocop) for great inspiration
766
- concerning their name and the structure of their README file. And special thanks
767
- to [SubGit](http://www.subgit.com/) for their great open source licensing.
768
-
769
776
  ## Copyright
770
777
 
771
- Copyright (c) 2019 Sitrox. See `LICENSE` for further details.
778
+ Copyright (c) 2020 Sitrox. See `LICENSE` for further details.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 2.4.1
1
+ 2.4.6
@@ -79,7 +79,7 @@
79
79
  <dl>
80
80
  <dt>Defined in:</dt>
81
81
  <dd>lib/schemacop.rb<span class="defines">,<br />
82
- lib/schemacop/node.rb,<br /> lib/schemacop/caster.rb,<br /> lib/schemacop/schema.rb,<br /> lib/schemacop/collector.rb,<br /> lib/schemacop/root_node.rb,<br /> lib/schemacop/field_node.rb,<br /> lib/schemacop/node_resolver.rb,<br /> lib/schemacop/node_with_block.rb,<br /> lib/schemacop/node_supporting_type.rb,<br /> lib/schemacop/node_supporting_field.rb,<br /> lib/schemacop/validator/nil_validator.rb,<br /> lib/schemacop/validator/hash_validator.rb,<br /> lib/schemacop/validator/array_validator.rb,<br /> lib/schemacop/validator/float_validator.rb,<br /> lib/schemacop/validator/number_validator.rb,<br /> lib/schemacop/validator/object_validator.rb,<br /> lib/schemacop/validator/string_validator.rb,<br /> lib/schemacop/validator/symbol_validator.rb,<br /> lib/schemacop/validator/boolean_validator.rb,<br /> lib/schemacop/validator/integer_validator.rb</span>
82
+ lib/schemacop/node.rb,<br /> lib/schemacop/caster.rb,<br /> lib/schemacop/dupper.rb,<br /> lib/schemacop/schema.rb,<br /> lib/schemacop/collector.rb,<br /> lib/schemacop/root_node.rb,<br /> lib/schemacop/field_node.rb,<br /> lib/schemacop/node_resolver.rb,<br /> lib/schemacop/node_with_block.rb,<br /> lib/schemacop/node_supporting_type.rb,<br /> lib/schemacop/node_supporting_field.rb,<br /> lib/schemacop/validator/nil_validator.rb,<br /> lib/schemacop/validator/hash_validator.rb,<br /> lib/schemacop/validator/array_validator.rb,<br /> lib/schemacop/validator/float_validator.rb,<br /> lib/schemacop/validator/number_validator.rb,<br /> lib/schemacop/validator/object_validator.rb,<br /> lib/schemacop/validator/string_validator.rb,<br /> lib/schemacop/validator/symbol_validator.rb,<br /> lib/schemacop/validator/boolean_validator.rb,<br /> lib/schemacop/validator/integer_validator.rb</span>
83
83
  </dd>
84
84
  </dl>
85
85
 
@@ -93,7 +93,7 @@
93
93
 
94
94
 
95
95
 
96
- <strong class="classes">Classes:</strong> <span class='object_link'><a href="Schemacop/ArrayValidator.html" title="Schemacop::ArrayValidator (class)">ArrayValidator</a></span>, <span class='object_link'><a href="Schemacop/BooleanValidator.html" title="Schemacop::BooleanValidator (class)">BooleanValidator</a></span>, <span class='object_link'><a href="Schemacop/Caster.html" title="Schemacop::Caster (class)">Caster</a></span>, <span class='object_link'><a href="Schemacop/Collector.html" title="Schemacop::Collector (class)">Collector</a></span>, <span class='object_link'><a href="Schemacop/FieldNode.html" title="Schemacop::FieldNode (class)">FieldNode</a></span>, <span class='object_link'><a href="Schemacop/FloatValidator.html" title="Schemacop::FloatValidator (class)">FloatValidator</a></span>, <span class='object_link'><a href="Schemacop/HashValidator.html" title="Schemacop::HashValidator (class)">HashValidator</a></span>, <span class='object_link'><a href="Schemacop/IntegerValidator.html" title="Schemacop::IntegerValidator (class)">IntegerValidator</a></span>, <span class='object_link'><a href="Schemacop/NilValidator.html" title="Schemacop::NilValidator (class)">NilValidator</a></span>, <span class='object_link'><a href="Schemacop/Node.html" title="Schemacop::Node (class)">Node</a></span>, <span class='object_link'><a href="Schemacop/NodeResolver.html" title="Schemacop::NodeResolver (class)">NodeResolver</a></span>, <span class='object_link'><a href="Schemacop/NodeSupportingField.html" title="Schemacop::NodeSupportingField (class)">NodeSupportingField</a></span>, <span class='object_link'><a href="Schemacop/NodeSupportingType.html" title="Schemacop::NodeSupportingType (class)">NodeSupportingType</a></span>, <span class='object_link'><a href="Schemacop/NodeWithBlock.html" title="Schemacop::NodeWithBlock (class)">NodeWithBlock</a></span>, <span class='object_link'><a href="Schemacop/NumberValidator.html" title="Schemacop::NumberValidator (class)">NumberValidator</a></span>, <span class='object_link'><a href="Schemacop/ObjectValidator.html" title="Schemacop::ObjectValidator (class)">ObjectValidator</a></span>, <span class='object_link'><a href="Schemacop/RootNode.html" title="Schemacop::RootNode (class)">RootNode</a></span>, <span class='object_link'><a href="Schemacop/Schema.html" title="Schemacop::Schema (class)">Schema</a></span>, <span class='object_link'><a href="Schemacop/StringValidator.html" title="Schemacop::StringValidator (class)">StringValidator</a></span>, <span class='object_link'><a href="Schemacop/SymbolValidator.html" title="Schemacop::SymbolValidator (class)">SymbolValidator</a></span>
96
+ <strong class="classes">Classes:</strong> <span class='object_link'><a href="Schemacop/ArrayValidator.html" title="Schemacop::ArrayValidator (class)">ArrayValidator</a></span>, <span class='object_link'><a href="Schemacop/BooleanValidator.html" title="Schemacop::BooleanValidator (class)">BooleanValidator</a></span>, <span class='object_link'><a href="Schemacop/Caster.html" title="Schemacop::Caster (class)">Caster</a></span>, <span class='object_link'><a href="Schemacop/Collector.html" title="Schemacop::Collector (class)">Collector</a></span>, <span class='object_link'><a href="Schemacop/Dupper.html" title="Schemacop::Dupper (class)">Dupper</a></span>, <span class='object_link'><a href="Schemacop/FieldNode.html" title="Schemacop::FieldNode (class)">FieldNode</a></span>, <span class='object_link'><a href="Schemacop/FloatValidator.html" title="Schemacop::FloatValidator (class)">FloatValidator</a></span>, <span class='object_link'><a href="Schemacop/HashValidator.html" title="Schemacop::HashValidator (class)">HashValidator</a></span>, <span class='object_link'><a href="Schemacop/IntegerValidator.html" title="Schemacop::IntegerValidator (class)">IntegerValidator</a></span>, <span class='object_link'><a href="Schemacop/NilValidator.html" title="Schemacop::NilValidator (class)">NilValidator</a></span>, <span class='object_link'><a href="Schemacop/Node.html" title="Schemacop::Node (class)">Node</a></span>, <span class='object_link'><a href="Schemacop/NodeResolver.html" title="Schemacop::NodeResolver (class)">NodeResolver</a></span>, <span class='object_link'><a href="Schemacop/NodeSupportingField.html" title="Schemacop::NodeSupportingField (class)">NodeSupportingField</a></span>, <span class='object_link'><a href="Schemacop/NodeSupportingType.html" title="Schemacop::NodeSupportingType (class)">NodeSupportingType</a></span>, <span class='object_link'><a href="Schemacop/NodeWithBlock.html" title="Schemacop::NodeWithBlock (class)">NodeWithBlock</a></span>, <span class='object_link'><a href="Schemacop/NumberValidator.html" title="Schemacop::NumberValidator (class)">NumberValidator</a></span>, <span class='object_link'><a href="Schemacop/ObjectValidator.html" title="Schemacop::ObjectValidator (class)">ObjectValidator</a></span>, <span class='object_link'><a href="Schemacop/RootNode.html" title="Schemacop::RootNode (class)">RootNode</a></span>, <span class='object_link'><a href="Schemacop/Schema.html" title="Schemacop::Schema (class)">Schema</a></span>, <span class='object_link'><a href="Schemacop/StringValidator.html" title="Schemacop::StringValidator (class)">StringValidator</a></span>, <span class='object_link'><a href="Schemacop/SymbolValidator.html" title="Schemacop::SymbolValidator (class)">SymbolValidator</a></span>
97
97
 
98
98
 
99
99
  </p>
@@ -111,7 +111,7 @@
111
111
  </dt>
112
112
  <dd><pre class="code"><span class='lbrace'>{</span>
113
113
  <span class='const'>String</span> <span class='op'>=&gt;</span> <span class='lbrace'>{</span>
114
- <span class='const'>Integer</span> <span class='op'>=&gt;</span> <span class='id identifier rubyid_proc'>proc</span> <span class='lbrace'>{</span> <span class='op'>|</span><span class='id identifier rubyid_s'>s</span><span class='op'>|</span> <span class='const'>Integer</span><span class='lparen'>(</span><span class='id identifier rubyid_s'>s</span><span class='rparen'>)</span> <span class='rbrace'>}</span><span class='comma'>,</span>
114
+ <span class='const'>Integer</span> <span class='op'>=&gt;</span> <span class='id identifier rubyid_proc'>proc</span> <span class='lbrace'>{</span> <span class='op'>|</span><span class='id identifier rubyid_s'>s</span><span class='op'>|</span> <span class='const'>Integer</span><span class='lparen'>(</span><span class='id identifier rubyid_s'>s</span><span class='comma'>,</span> <span class='int'>10</span><span class='rparen'>)</span> <span class='rbrace'>}</span><span class='comma'>,</span>
115
115
  <span class='const'>Float</span> <span class='op'>=&gt;</span> <span class='id identifier rubyid_proc'>proc</span> <span class='lbrace'>{</span> <span class='op'>|</span><span class='id identifier rubyid_s'>s</span><span class='op'>|</span> <span class='const'>Float</span><span class='lparen'>(</span><span class='id identifier rubyid_s'>s</span><span class='rparen'>)</span> <span class='rbrace'>}</span>
116
116
  <span class='rbrace'>}</span><span class='comma'>,</span>
117
117
  <span class='const'>Float</span> <span class='op'>=&gt;</span> <span class='lbrace'>{</span>
@@ -136,7 +136,7 @@
136
136
  </div>
137
137
 
138
138
  <div id="footer">
139
- Generated on Mon Oct 28 16:25:03 2019 by
139
+ Generated on Mon Jun 29 17:18:17 2020 by
140
140
  <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
141
141
  0.9.20 (ruby-2.6.2).
142
142
  </div>
@@ -319,7 +319,7 @@
319
319
  </div>
320
320
 
321
321
  <div id="footer">
322
- Generated on Mon Oct 28 16:25:04 2019 by
322
+ Generated on Mon Jun 29 17:18:17 2020 by
323
323
  <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
324
324
  0.9.20 (ruby-2.6.2).
325
325
  </div>
@@ -135,7 +135,7 @@
135
135
  </div>
136
136
 
137
137
  <div id="footer">
138
- Generated on Mon Oct 28 16:25:04 2019 by
138
+ Generated on Mon Jun 29 17:18:17 2020 by
139
139
  <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
140
140
  0.9.20 (ruby-2.6.2).
141
141
  </div>
@@ -369,7 +369,7 @@
369
369
  </div>
370
370
 
371
371
  <div id="footer">
372
- Generated on Mon Oct 28 16:25:03 2019 by
372
+ Generated on Mon Jun 29 17:18:17 2020 by
373
373
  <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
374
374
  0.9.20 (ruby-2.6.2).
375
375
  </div>
@@ -777,7 +777,7 @@ called.

777
777
  </div>
778
778
 
779
779
  <div id="footer">
780
- Generated on Mon Oct 28 16:25:04 2019 by
780
+ Generated on Mon Jun 29 17:18:17 2020 by
781
781
  <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
782
782
  0.9.20 (ruby-2.6.2).
783
783
  </div>
@@ -0,0 +1,214 @@
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::Dupper
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::Dupper";
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 (D)</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">Dupper</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::Dupper
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::Dupper</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/dupper.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="#dup_data-class_method" title="dup_data (class method)">.<strong>dup_data</strong>(data) &#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
+ </ul>
140
+
141
+
142
+
143
+
144
+ <div id="class_method_details" class="method_details_list">
145
+ <h2>Class Method Details</h2>
146
+
147
+
148
+ <div class="method_details first">
149
+ <h3 class="signature first" id="dup_data-class_method">
150
+
151
+ .<strong>dup_data</strong>(data) &#x21d2; <tt>Object</tt>
152
+
153
+
154
+
155
+
156
+
157
+ </h3><table class="source_code">
158
+ <tr>
159
+ <td>
160
+ <pre class="lines">
161
+
162
+
163
+ 3
164
+ 4
165
+ 5
166
+ 6
167
+ 7
168
+ 8
169
+ 9
170
+ 10
171
+ 11
172
+ 12
173
+ 13
174
+ 14
175
+ 15
176
+ 16
177
+ 17</pre>
178
+ </td>
179
+ <td>
180
+ <pre class="code"><span class="info file"># File 'lib/schemacop/dupper.rb', line 3</span>
181
+
182
+ <span class='kw'>def</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_dup_data'>dup_data</span><span class='lparen'>(</span><span class='id identifier rubyid_data'>data</span><span class='rparen'>)</span>
183
+ <span class='kw'>if</span> <span class='id identifier rubyid_data'>data</span><span class='period'>.</span><span class='id identifier rubyid_is_a?'>is_a?</span><span class='lparen'>(</span><span class='const'>Hash</span><span class='rparen'>)</span>
184
+ <span class='id identifier rubyid_data'>data</span> <span class='op'>=</span> <span class='id identifier rubyid_data'>data</span><span class='period'>.</span><span class='id identifier rubyid_dup'>dup</span>
185
+
186
+ <span class='id identifier rubyid_data'>data</span><span class='period'>.</span><span class='id identifier rubyid_each'>each</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id identifier rubyid_key'>key</span><span class='comma'>,</span> <span class='id identifier rubyid_value'>value</span><span class='op'>|</span>
187
+ <span class='id identifier rubyid_data'>data</span><span class='lbracket'>[</span><span class='id identifier rubyid_key'>key</span><span class='rbracket'>]</span> <span class='op'>=</span> <span class='id identifier rubyid_dup_data'>dup_data</span><span class='lparen'>(</span><span class='id identifier rubyid_value'>value</span><span class='rparen'>)</span>
188
+ <span class='kw'>end</span>
189
+
190
+ <span class='kw'>return</span> <span class='id identifier rubyid_data'>data</span>
191
+ <span class='kw'>elsif</span> <span class='id identifier rubyid_data'>data</span><span class='period'>.</span><span class='id identifier rubyid_is_a?'>is_a?</span><span class='lparen'>(</span><span class='const'>Array</span><span class='rparen'>)</span>
192
+ <span class='kw'>return</span> <span class='id identifier rubyid_data'>data</span><span class='period'>.</span><span class='id identifier rubyid_map'>map</span> <span class='lbrace'>{</span> <span class='op'>|</span><span class='id identifier rubyid_value'>value</span><span class='op'>|</span> <span class='id identifier rubyid_dup_data'>dup_data</span><span class='lparen'>(</span><span class='id identifier rubyid_value'>value</span><span class='rparen'>)</span> <span class='rbrace'>}</span>
193
+ <span class='kw'>else</span>
194
+ <span class='kw'>return</span> <span class='id identifier rubyid_data'>data</span>
195
+ <span class='kw'>end</span>
196
+ <span class='kw'>end</span></pre>
197
+ </td>
198
+ </tr>
199
+ </table>
200
+ </div>
201
+
202
+ </div>
203
+
204
+ </div>
205
+
206
+ <div id="footer">
207
+ Generated on Mon Jun 29 17:18:17 2020 by
208
+ <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
209
+ 0.9.20 (ruby-2.6.2).
210
+ </div>
211
+
212
+ </div>
213
+ </body>
214
+ </html>
@@ -105,7 +105,7 @@
105
105
  </div>
106
106
 
107
107
  <div id="footer">
108
- Generated on Mon Oct 28 16:25:03 2019 by
108
+ Generated on Mon Jun 29 17:18:17 2020 by
109
109
  <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
110
110
  0.9.20 (ruby-2.6.2).
111
111
  </div>
@@ -114,7 +114,7 @@
114
114
  </div>
115
115
 
116
116
  <div id="footer">
117
- Generated on Mon Oct 28 16:25:04 2019 by
117
+ Generated on Mon Jun 29 17:18:17 2020 by
118
118
  <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
119
119
  0.9.20 (ruby-2.6.2).
120
120
  </div>
@@ -114,7 +114,7 @@
114
114
  </div>
115
115
 
116
116
  <div id="footer">
117
- Generated on Mon Oct 28 16:25:04 2019 by
117
+ Generated on Mon Jun 29 17:18:17 2020 by
118
118
  <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
119
119
  0.9.20 (ruby-2.6.2).
120
120
  </div>
@@ -411,7 +411,7 @@
411
411
  </div>
412
412
 
413
413
  <div id="footer">
414
- Generated on Mon Oct 28 16:25:04 2019 by
414
+ Generated on Mon Jun 29 17:18:17 2020 by
415
415
  <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
416
416
  0.9.20 (ruby-2.6.2).
417
417
  </div>