You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: validator.rb
    path of file: ./repos/hyper-react/lib/react
    
    the code of the file until where you have to start completion: module React
  class Validator
    attr_accessor :errors
    attr_reader :props_wrapper
    private :errors, :props_wrapper

    def initialize(props_wrapper = Class.new(Component::PropsWrapper))
      @props_wrapper = props_wrapper
    end

    def self.build(&block)
      self.new.build(&block)
    end

    
    
    def validate_types(prop_name, value)
      return unless klass = rules[prop_name][:type]
      if !klass.is_a?(Array)
        allow_nil = !!rules[prop_name][:allow_nil]
        type_check("`#{prop_name}`", value, klass, allow_nil)
      elsif klass.length > 0
        validate_value_array(prop_name, value)
      else
        allow_nil = !!rules[prop_name][:allow_nil]
        type_check("`#{prop_name}`", value, Array, allow_nil)
      end