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: 5beb3f86e652fe9246f46a535b8ca0f69fe22cd9b928c7a06e8d1b963e4332f6
4
- data.tar.gz: 93218ef8f7b73180d4e5d808a13e8ec13ddad048764d0deaf1e024518d5846c0
3
+ metadata.gz: 3f26fc4ef76b2db622187a6828bbee303a39bc2877d8d3b1f1005cf69a93efa2
4
+ data.tar.gz: 5a6a30ac70fdd3065313442c055ceafa3de7fedf3677c2ee6301967c539a0ba7
5
5
  SHA512:
6
- metadata.gz: 89cae77c9dd01b29e8595100923d212596ecf464077bda8ddb448ea749bac9b39d1fc1ed3ecc08483e74e0b44c6fc1df2fa65c848435ad20a22b7149929fe93a
7
- data.tar.gz: 370897d822e50dd27a3eb5c96c296da8fbf7ab24d02f9016a834a8b8e85dde1f5faef16ab4e1486aaf7d223b7e70f72942213506fd037b97478313a0d63b24ea
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
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module DryValidationParser
4
- VERSION = "0.1.3"
4
+ VERSION = "0.1.4"
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dry_validation_parser
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.3
4
+ version: 0.1.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jane-Terziev