Class: VagrantPlugins::ProxyConf::UserinfoURI
- Inherits:
-
Object
- Object
- VagrantPlugins::ProxyConf::UserinfoURI
- Defined in:
- lib/vagrant-proxyconf/userinfo_uri.rb
Overview
Helper class that strips userinfo from the URI to separate attributes
Instance Attribute Summary collapse
-
#pass ⇒ String
readonly
The password.
-
#uri ⇒ String
(also: #to_s)
readonly
The URI without userinfo.
-
#user ⇒ String
readonly
The username.
Instance Method Summary collapse
-
#initialize(uri) ⇒ UserinfoURI
constructor
A new instance of UserinfoURI.
Constructor Details
#initialize(uri) ⇒ UserinfoURI
Returns a new instance of UserinfoURI.
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
#pass ⇒ String (readonly)
Returns the password.
16 17 18 |
# File 'lib/vagrant-proxyconf/userinfo_uri.rb', line 16 def pass @pass end |
#uri ⇒ String (readonly) Also known as: to_s
Returns the URI without userinfo.
8 9 10 |
# File 'lib/vagrant-proxyconf/userinfo_uri.rb', line 8 def uri @uri end |
#user ⇒ String (readonly)
Returns the username.
13 14 15 |
# File 'lib/vagrant-proxyconf/userinfo_uri.rb', line 13 def user @user end |