Module: HTTPX::Plugins::Proxy::OptionsMethods

Defined in:
lib/httpx/plugins/proxy.rb

Overview

adds support for the following options:

:proxy

proxy options defining :uri, :username, :password or :scheme (i.e. { uri: "http://proxy" })

Instance Method Summary collapse

Instance Method Details

#option_proxy(value) ⇒ Object



138
139
140
# File 'lib/httpx/plugins/proxy.rb', line 138

def option_proxy(value)
  value.is_a?(Parameters) ? value : Parameters.new(**Hash[value])
end

#option_supported_proxy_protocols(value) ⇒ Object

Raises:

  • (TypeError)


142
143
144
145
146
# File 'lib/httpx/plugins/proxy.rb', line 142

def option_supported_proxy_protocols(value)
  raise TypeError, ":supported_proxy_protocols must be an Array" unless value.is_a?(Array)

  value.map(&:to_s)
end