File: profile_lax_schema_valid.rb

package info (click to toggle)
ruby-dry-types 1.2.2-2
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, bullseye, forky, sid, trixie
  • size: 504 kB
  • sloc: ruby: 3,059; makefile: 4
file content (16 lines) | stat: -rw-r--r-- 276 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
# frozen_string_literal: true

require_relative 'setup'

Schema = Dry::Types['params.hash'].schema(
  email?: 'string',
  age?: 'coercible.integer'
).lax

ValidInput = { email: 'jane@doe.org', age: '19' }.freeze

profile do
  10_000.times do
    Schema.(ValidInput)
  end
end