Class: ConfigBuilder::Model::Network::PublicNetwork

Inherits:
Base
  • Object
show all
Defined in:
lib/config_builder/model/network/public_network.rb

Overview

Vagrant public network

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Base

#attr, #attrs=, #call, #configure!, def_model_attribute, def_model_delegator, def_model_id, def_model_option, #eval_models, #instance_id, #instance_options, model_attributes, model_delegators, #model_delegators, model_options, new_from_hash, #with_attr

Instance Attribute Details

#:auto_config(: auto_config) ⇒ Boolean

Returns:

  • (Boolean)


23
# File 'lib/config_builder/model/network/public_network.rb', line 23

def_model_attribute :auto_config

#:bridge(: bridge) ⇒ String+

Returns If more than one network interface is available on the host machine, Vagrant will ask you to choose which interface the virtual machine should bridge to. A default interface can be specified by adding a :bridge clause to the network definition.

Returns:

  • (String, Array<String>)

    If more than one network interface is available on the host machine, Vagrant will ask you to choose which interface the virtual machine should bridge to. A default interface can be specified by adding a :bridge clause to the network definition.



15
# File 'lib/config_builder/model/network/public_network.rb', line 15

def_model_attribute :bridge

#:ip(: ip) ⇒ String

Returns The IP address to use for the public network interface.

Returns:

  • (String)

    The IP address to use for the public network interface.



8
# File 'lib/config_builder/model/network/public_network.rb', line 8

def_model_attribute :ip

#:use_dhcp_assigned_default_route(: use_dhcp_assigned_default_route) ⇒ Boolean

Returns:

  • (Boolean)


19
# File 'lib/config_builder/model/network/public_network.rb', line 19

def_model_attribute :use_dhcp_assigned_default_route

Instance Method Details

#public_network_optsObject



31
32
33
34
35
36
37
38
# File 'lib/config_builder/model/network/public_network.rb', line 31

def public_network_opts
  h = {}
  with_attr(:ip)                              { |val| h[:ip]                              = val }
  with_attr(:use_dhcp_assigned_default_route) { |val| h[:use_dhcp_assigned_default_route] = val }
  with_attr(:bridge)                          { |val| h[:bridge]                          = val }
  with_attr(:auto_config)                     { |val| h[:auto_config]                     = val }
  h
end

#to_procObject



25
26
27
28
29
# File 'lib/config_builder/model/network/public_network.rb', line 25

def to_proc
  Proc.new do |vm_config|
    vm_config.network(:public_network, public_network_opts)
  end
end