jimmy 0.4.3 → 0.4.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/jimmy/schema_types/array.rb +2 -1
- data/lib/jimmy/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: fd49ef4d4b05d882f3725e1a218a36d3b284a700
|
4
|
+
data.tar.gz: 106425471819a818f6d7f02f015a75c6f80b9284
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 038ae82ea61923a19dfe426c495ebc31f63cc3e99e3e3f6f10321800cc2d50c55eead86712502ac1b77f8919e33732df61adb32a0c4da009d91a86d32af376b9
|
7
|
+
data.tar.gz: 778c1788969d57776069c776a2947b9689fb9fd09767f013e4bb647f379ff50b51a0968923552f6486c2cee626a86efcd691175f9c6b605950035a151f4d88fc
|
@@ -4,6 +4,7 @@ module Jimmy
|
|
4
4
|
|
5
5
|
trait :min_items
|
6
6
|
trait :max_items
|
7
|
+
trait(:unique) { attrs[:unique_items] = true }
|
7
8
|
trait Range do |range|
|
8
9
|
min, max = [range.first, range.last].sort
|
9
10
|
min_items min
|
@@ -16,7 +17,7 @@ module Jimmy
|
|
16
17
|
end
|
17
18
|
|
18
19
|
compile do |hash|
|
19
|
-
hash.merge! camelize_attrs(%i[min_items max_items])
|
20
|
+
hash.merge! camelize_attrs(%i[min_items max_items unique_items])
|
20
21
|
items = attrs[:items] || []
|
21
22
|
if items.length > 1
|
22
23
|
hash['items'] = {'anyOf' => items.map(&:compile)}
|
data/lib/jimmy/version.rb
CHANGED