Class: VagrantPlugins::ProxyConf::Config::AptProxy::ConfigValue

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(proto, value) ⇒ ConfigValue

Returns a new instance of ConfigValue.

Parameters:

  • proto (String)

    the protocol (“http”, “https”, …)

  • value (Object)

    the configuration value



58
59
60
61
# File 'lib/vagrant-proxyconf/config/apt_proxy.rb', line 58

def initialize(proto, value)
  @proto = proto
  @value = value
end

Instance Attribute Details

#protoObject (readonly)

Returns the value of attribute proto.



54
55
56
# File 'lib/vagrant-proxyconf/config/apt_proxy.rb', line 54

def proto
  @proto
end

#valueObject (readonly)

Returns the value of attribute value.



54
55
56
# File 'lib/vagrant-proxyconf/config/apt_proxy.rb', line 54

def value
  @value
end

Instance Method Details

#to_sString

Returns the full Apt configuration line.

Returns:

  • (String)

    the full Apt configuration line



64
65
66
# File 'lib/vagrant-proxyconf/config/apt_proxy.rb', line 64

def to_s
  set? ? %Q{Acquire::#{proto}::Proxy "#{proxy_uri}";\n} : ""
end