dry_validation_parser 0.1.3 → 0.1.4
Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3f26fc4ef76b2db622187a6828bbee303a39bc2877d8d3b1f1005cf69a93efa2
|
4
|
+
data.tar.gz: 5a6a30ac70fdd3065313442c055ceafa3de7fedf3677c2ee6301967c539a0ba7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2325960029165a39c80d061845ee8820f3b5542433b35884763855dc9f4f45462c0178fa12b8e6b635bd20e459dc2e10518c914ca9b1e8a64d18c02e0cd381cd
|
7
|
+
data.tar.gz: 016a50094f19f0db48106b2bc7e60e2829871276c20c781453bae490a7abcdd6b02838b808e00cec8b4ffb51c12c95ef9fbeead3b39e20048e5783ef16e55d37
|
@@ -106,7 +106,18 @@ module DryValidationParser
|
|
106
106
|
keys[key][:enum] += [nil] if opts.fetch(:nullable, false)
|
107
107
|
elsif PREDICATE_TO_TYPE[name]
|
108
108
|
keys[key][:type] = PREDICATE_TO_TYPE[name]
|
109
|
+
else
|
110
|
+
description = predicate_description(name.to_s, rest[0][1].to_s)
|
111
|
+
if keys[key][:description].to_s.empty?
|
112
|
+
keys[key][:description] = description unless description.to_s.empty?
|
113
|
+
else
|
114
|
+
keys[key][:description] += ", #{description}" unless description.to_s.empty?
|
115
|
+
end
|
109
116
|
end
|
110
117
|
end
|
118
|
+
|
119
|
+
def predicate_description(name, value)
|
120
|
+
"#{name}: #{value}"
|
121
|
+
end
|
111
122
|
end
|
112
123
|
end
|