Sha256: 75a1141e7b55118af8975cd10eaf24498f5cb7ee850984d42e17de412bdfebb4
Contents?: true
Size: 342 Bytes
Versions: 6
Compression:
Stored size: 342 Bytes
Contents
require 'dry-validation' class Schema < Dry::Validation::Schema key(:email) { |email| email.filled? } key(:age) do |age| age.int? & age.gt?(18) end end schema = Schema.new 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
6 entries across 6 versions & 1 rubygems