class HTTPX::Plugins::Proxy::Parameters

  1. lib/httpx/plugins/proxy.rb
Superclass: Object

Methods

Public Class

  1. new

Public Instance

  1. ==
  2. authenticated?
  3. password
  4. token_authentication
  5. uri
  6. username

Attributes

password [R]
uri [R]
username [R]

Public Class methods

new (uri:, username: nil, password: nil)
[show source]
   # File lib/httpx/plugins/proxy.rb
26 def initialize(uri:, username: nil, password: nil)
27   @uri = uri.is_a?(URI::Generic) ? uri : URI(uri)
28   @username = username || @uri.user
29   @password = password || @uri.password
30 end

Public Instance methods

== (other)
[show source]
   # File lib/httpx/plugins/proxy.rb
40 def ==(other)
41   if other.is_a?(Parameters)
42     @uri == other.uri &&
43       @username == other.username &&
44       @password == other.password
45   else
46     super
47   end
48 end
authenticated? ()
[show source]
   # File lib/httpx/plugins/proxy.rb
32 def authenticated?
33   @username && @password
34 end
token_authentication ()
[show source]
   # File lib/httpx/plugins/proxy.rb
36 def token_authentication
37   Base64.strict_encode64("#{user}:#{password}")
38 end