Sha256: dfc3a639e48b482bab7b4a0fc859cef83dcc75b1e862a52224fececd06775339

Contents?: true

Size: 350 Bytes

Versions: 9

Compression:

Stored size: 350 Bytes

Contents

# frozen_string_literal: true

module Openapi3Parser
  module Validation
    class InputValidator
      attr_reader :callable

      def initialize(callable)
        @callable = callable
      end

      def call(validatable)
        error = @callable.call(validatable.input)
        validatable.add_error(error) if error
      end
    end
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
openapi3_parser-0.8.2 lib/openapi3_parser/validation/input_validator.rb
openapi3_parser-0.8.1 lib/openapi3_parser/validation/input_validator.rb
openapi3_parser-0.8.0 lib/openapi3_parser/validation/input_validator.rb
openapi3_parser-0.7.0 lib/openapi3_parser/validation/input_validator.rb
openapi3_parser-0.6.1 lib/openapi3_parser/validation/input_validator.rb
openapi3_parser-0.6.0 lib/openapi3_parser/validation/input_validator.rb
openapi3_parser-0.5.2 lib/openapi3_parser/validation/input_validator.rb
openapi3_parser-0.5.1 lib/openapi3_parser/validation/input_validator.rb
openapi3_parser-0.5.0 lib/openapi3_parser/validation/input_validator.rb