Class: Vagrant::Config::Container
- Inherits:
-
Object
- Object
- Vagrant::Config::Container
- Defined in:
- lib/vagrant/config/container.rb
Overview
Contains loaded configuration values and provides access to those values.
This is the class returned when loading configuration and stores the completely loaded configuration values. This class is meant to be immutable.
Instance Attribute Summary collapse
-
#global ⇒ Object
readonly
Returns the value of attribute global.
-
#vms ⇒ Object
readonly
Returns the value of attribute vms.
Instance Method Summary collapse
-
#for_vm(name) ⇒ Object
This returns the configuration for a specific virtual machine.
-
#initialize(global, vms) ⇒ Container
constructor
Initializes the configuration container.
Constructor Details
#initialize(global, vms) ⇒ Container
Initializes the configuration container.
18 19 20 21 22 23 24 25 26 27 |
# File 'lib/vagrant/config/container.rb', line 18 def initialize(global, vms) @global = global @vms = [] @vm_configs = {} vms.each do |vm_config| @vms << vm_config.vm.name @vm_configs[vm_config.vm.name] = vm_config end end |
Instance Attribute Details
#global ⇒ Object (readonly)
Returns the value of attribute global.
10 11 12 |
# File 'lib/vagrant/config/container.rb', line 10 def global @global end |
#vms ⇒ Object (readonly)
Returns the value of attribute vms.
11 12 13 |
# File 'lib/vagrant/config/container.rb', line 11 def vms @vms end |
Instance Method Details
#for_vm(name) ⇒ Object
This returns the configuration for a specific virtual machine. The values for this configuration are usually pertinent to a single virtual machine and do not affect the system globally.
32 33 34 |
# File 'lib/vagrant/config/container.rb', line 32 def for_vm(name) @vm_configs[name] end |