Class: VagrantPlugins::ProxyConf::Config::AptProxy
- Inherits:
-
Object
- Object
- VagrantPlugins::ProxyConf::Config::AptProxy
- Defined in:
- lib/vagrant-proxyconf/config/apt_proxy.rb
Defined Under Namespace
Classes: ConfigValue
Instance Attribute Summary collapse
-
#ftp ⇒ Object
FTP proxy for Apt.
-
#http ⇒ Object
HTTP proxy for Apt.
-
#https ⇒ Object
HTTPS proxy for Apt.
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.
16 17 18 19 20 |
# File 'lib/vagrant-proxyconf/config/apt_proxy.rb', line 16 def initialize @http = UNSET_VALUE @https = UNSET_VALUE @ftp = UNSET_VALUE end |
Instance Attribute Details
#ftp ⇒ Object
FTP proxy for Apt
14 15 16 |
# File 'lib/vagrant-proxyconf/config/apt_proxy.rb', line 14 def ftp @ftp end |
#http ⇒ Object
HTTP proxy for Apt
8 9 10 |
# File 'lib/vagrant-proxyconf/config/apt_proxy.rb', line 8 def http @http end |
#https ⇒ Object
HTTPS proxy for Apt
11 12 13 |
# File 'lib/vagrant-proxyconf/config/apt_proxy.rb', line 11 def https @https end |
Instance Method Details
#enabled? ⇒ Boolean
33 34 35 |
# File 'lib/vagrant-proxyconf/config/apt_proxy.rb', line 33 def enabled? !http.nil? || !https.nil? || !ftp.nil? end |
#finalize! ⇒ Object
22 23 24 25 26 27 28 29 30 31 |
# File 'lib/vagrant-proxyconf/config/apt_proxy.rb', line 22 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.
38 39 40 |
# File 'lib/vagrant-proxyconf/config/apt_proxy.rb', line 38 def to_s %w[http https ftp].map { |proto| config_for(proto) }.join end |