Class: VagrantPlugins::ProxyConf::UserinfoURI

Inherits:
Object
  • Object
show all
Defined in:
lib/vagrant-proxyconf/userinfo_uri.rb

Overview

Helper class that strips userinfo from the URI to separate attributes

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(uri) ⇒ UserinfoURI

Returns a new instance of UserinfoURI.

Parameters:

  • uri (String)

    the URI including optional userinfo



19
20
21
22
23
24
25
26
# File 'lib/vagrant-proxyconf/userinfo_uri.rb', line 19

def initialize(uri)
  if uri
    u = URI.parse(uri)
    @uri  = strip_userinfo(u)
    @user = u.user
    @pass = u.password
  end
end

Instance Attribute Details

#passString (readonly)

Returns the password.

Returns:

  • (String)

    the password



16
17
18
# File 'lib/vagrant-proxyconf/userinfo_uri.rb', line 16

def pass
  @pass
end

#uriString (readonly) Also known as: to_s

Returns the URI without userinfo.

Returns:

  • (String)

    the URI without userinfo



8
9
10
# File 'lib/vagrant-proxyconf/userinfo_uri.rb', line 8

def uri
  @uri
end

#userString (readonly)

Returns the username.

Returns:

  • (String)

    the username



13
14
15
# File 'lib/vagrant-proxyconf/userinfo_uri.rb', line 13

def user
  @user
end