Sha256: 0dc9ed472faf1151f939cbdecbee39f74b190d6abb1592a8c8b9cd4e0fc7924b

Contents?: true

Size: 283 Bytes

Versions: 5

Compression:

Stored size: 283 Bytes

Contents

require 'dry-validation'

schema = Dry::Validation.Schema do
  key(:email).required

  key(:age).required(:int?, gt?: 18)
end

errors = schema.call(email: 'jane@doe.org', age: 19).messages

puts errors.inspect

errors = schema.call(email: nil, age: 19).messages

puts errors.inspect

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
dry-validation-0.7.4 examples/basic.rb
dry-validation-0.7.3 examples/basic.rb
dry-validation-0.7.2 examples/basic.rb
dry-validation-0.7.1 examples/basic.rb
dry-validation-0.7.0 examples/basic.rb