Sha256: 70a37fb568acbf1380b74921f8379b9be83ee6a7851b1593ea2647647b2f21db

Contents?: true

Size: 289 Bytes

Versions: 26

Compression:

Stored size: 289 Bytes

Contents

require 'dry-validation'

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

  required(:age).filled(: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

26 entries across 26 versions & 1 rubygems

Version Path
dry-validation-0.13.3 examples/basic.rb
dry-validation-0.13.2 examples/basic.rb
dry-validation-0.13.1 examples/basic.rb
dry-validation-0.11.2 examples/basic.rb
dry-validation-0.12.3 examples/basic.rb
dry-validation-0.13.0 examples/basic.rb
dry-validation-0.12.2 examples/basic.rb
dry-validation-0.12.1 examples/basic.rb
dry-validation-0.12.0 examples/basic.rb
dry-validation-0.11.1 examples/basic.rb
dry-validation-0.11.0 examples/basic.rb
dry-validation-0.10.7 examples/basic.rb
dry-validation-0.10.6 examples/basic.rb
dry-validation-0.10.5 examples/basic.rb
dry-validation-0.10.4 examples/basic.rb
dry-validation-0.10.3 examples/basic.rb
dry-validation-0.10.2 examples/basic.rb
dry-validation-0.10.1 examples/basic.rb
dry-validation-0.10.0 examples/basic.rb
dry-validation-0.9.5 examples/basic.rb