Class: VagrantPlugins::Invade::InvadeModule::Network::Public
- Inherits:
-
InvadeModule
- Object
- InvadeModule
- VagrantPlugins::Invade::InvadeModule::Network::Public
- Defined in:
- lib/vagrant-invade/module/network/public/public.rb
Instance Attribute Summary collapse
-
#machine_name ⇒ Object
Returns the value of attribute machine_name.
-
#public_network_data ⇒ Object
Returns the value of attribute public_network_data.
-
#result ⇒ Object
readonly
Returns the value of attribute result.
Instance Method Summary collapse
- #build ⇒ Object
-
#initialize(machine_name, public_network_data, result: nil) ⇒ Public
constructor
A new instance of Public.
Methods inherited from InvadeModule
Constructor Details
#initialize(machine_name, public_network_data, result: nil) ⇒ Public
Returns a new instance of Public.
11 12 13 14 15 |
# File 'lib/vagrant-invade/module/network/public/public.rb', line 11 def initialize(machine_name, public_network_data, result: nil) @machine_name = machine_name @public_network_data = public_network_data @result = result end |
Instance Attribute Details
#machine_name ⇒ Object
Returns the value of attribute machine_name.
9 10 11 |
# File 'lib/vagrant-invade/module/network/public/public.rb', line 9 def machine_name @machine_name end |
#public_network_data ⇒ Object
Returns the value of attribute public_network_data.
9 10 11 |
# File 'lib/vagrant-invade/module/network/public/public.rb', line 9 def public_network_data @public_network_data end |
#result ⇒ Object (readonly)
Returns the value of attribute result.
8 9 10 |
# File 'lib/vagrant-invade/module/network/public/public.rb', line 8 def result @result end |
Instance Method Details
#build ⇒ Object
17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 |
# File 'lib/vagrant-invade/module/network/public/public.rb', line 17 def build b = binding begin # Get machine name machine_name = @machine_name # Values for network section ip = @public_network_data['ip'] dhcp = @public_network_data['dhcp'] bridge = @public_network_data['bridge'] auto_config = @public_network_data['auto_config'] eruby = Erubis::Eruby.new(File.read(self.get_template_path(__FILE__))) @result = eruby.result b rescue StandardError => e raise(e) end end |