Class: VagrantPlugins::ProxyConf::Config::AptProxy
- Inherits:
-
Vagrant::Plugin::V2::Config
- Object
- Vagrant::Plugin::V2::Config
- VagrantPlugins::ProxyConf::Config::AptProxy
- Defined in:
- lib/vagrant-proxyconf/config/apt_proxy.rb,
lib/vagrant-proxyconf/config/apt_proxy.rb
Overview
Proxy configuration for Apt
Defined Under Namespace
Classes: ConfigValue
Instance Attribute Summary collapse
-
#ftp ⇒ String
The FTP proxy.
-
#http ⇒ String
The HTTP proxy.
-
#https ⇒ String
The HTTPS proxy.
Instance Method Summary collapse
- #enabled? ⇒ Boolean
- #finalize! ⇒ Object
-
#initialize ⇒ AptProxy
constructor
A new instance of AptProxy.
-
#to_s ⇒ String
The full configuration stanza.
Constructor Details
#initialize ⇒ AptProxy
Returns a new instance of AptProxy.
19 20 21 22 23 |
# File 'lib/vagrant-proxyconf/config/apt_proxy.rb', line 19 def initialize @http = UNSET_VALUE @https = UNSET_VALUE @ftp = UNSET_VALUE end |
Instance Attribute Details
#ftp ⇒ String
Returns the FTP proxy.
17 18 19 |
# File 'lib/vagrant-proxyconf/config/apt_proxy.rb', line 17 def ftp @ftp end |
#http ⇒ String
Returns the HTTP proxy.
11 12 13 |
# File 'lib/vagrant-proxyconf/config/apt_proxy.rb', line 11 def http @http end |
#https ⇒ String
Returns the HTTPS proxy.
14 15 16 |
# File 'lib/vagrant-proxyconf/config/apt_proxy.rb', line 14 def https @https end |
Instance Method Details
#enabled? ⇒ Boolean
36 37 38 |
# File 'lib/vagrant-proxyconf/config/apt_proxy.rb', line 36 def enabled? !http.nil? || !https.nil? || !ftp.nil? end |
#finalize! ⇒ Object
25 26 27 28 29 30 31 32 33 34 |
# File 'lib/vagrant-proxyconf/config/apt_proxy.rb', line 25 def finalize! @http = override_from_env_var('http', @http) @http = nil if @http == UNSET_VALUE @https = override_from_env_var('https', @https) @https = nil if @https == UNSET_VALUE @ftp = override_from_env_var('ftp', @ftp) @ftp = nil if @ftp == UNSET_VALUE end |
#to_s ⇒ String
Returns the full configuration stanza.
41 42 43 |
# File 'lib/vagrant-proxyconf/config/apt_proxy.rb', line 41 def to_s %w[http https ftp].map { |proto| config_for(proto) }.join end |