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: proxy.rb
    path of file: ./repos/spidr/lib/spidr/settings
    
    the code of the file until where you have to start completion: # frozen_string_literal: true

require_relative '../proxy'

require 'uri/http'

module Spidr
  module Settings
    #
    # Methods for configuring a proxy.
    #
    # @since 0.6.0
    #
    module Proxy
      #
      # Proxy information used by all newly created Agent objects by defaul
    
      def proxy=(new_proxy)
        @proxy = case new_proxy
                 when Spidr::Proxy
                   new_proxy
                 when Hash
                   Spidr::Proxy.new(**new_proxy)
                 when String, URI::HTTP
                   proxy_uri = URI(new_proxy)

                   Spidr::Proxy.new(
                      host:     proxy_uri.host,
                      port:     proxy_uri.port,
                      user:     proxy_uri.user,
                      password: proxy_uri.password
                   )
                 when nil
                   Spidr::Proxy.new
                 else
                   raise(TypeError,"#{self.class}#{__method__} only accepts Spidr::Proxy, URI::HTTP, Hash, or nil")
                 end