Sha256: 5ea5bd35991513ad475b237d6048b28a00a1d9de1d554a2b4336886121ef803a

Contents?: true

Size: 378 Bytes

Versions: 6

Compression:

Stored size: 378 Bytes

Contents

require 'dry/validation/schema'
require 'dry/validation/input_type_compiler'

module Dry
  module Validation
    class Schema::Form < Schema
      attr_reader :input_type

      def initialize
        super
        @input_type = InputTypeCompiler.new.(self.class.rules.map(&:to_ary))
      end

      def call(input)
        super(input_type[input])
      end
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
dry-validation-0.5.0 lib/dry/validation/schema/form.rb
dry-validation-0.4.1 lib/dry/validation/schema/form.rb
dry-validation-0.4.0 lib/dry/validation/schema/form.rb
dry-validation-0.3.1 lib/dry/validation/schema/form.rb
dry-validation-0.3.0 lib/dry/validation/schema/form.rb
dry-validation-0.2.0 lib/dry/validation/schema/form.rb