dry-validation/bin/console

32 lines
514 B
Ruby
Executable File

#!/usr/bin/env ruby
# frozen_string_literal: true
require "pry"
require "bundler/setup"
require "dry-validation"
module Types
include Dry::Types()
end
class Context
def schema(&block)
Dry::Schema.define(&block)
end
def params(&block)
Dry::Schema.Params(&block)
end
def json(&block)
Dry::Schema.JSON(&block)
end
def contract(&block)
Dry::Validation::Contract.build(&block)
end
end
Pry.start(Context.new, prompt: [proc { "dry-validation> " }, proc { "dry-validation*> " }])