Class: ConfigBuilder::Model::Network::ForwardedPort

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

Overview

Vagrant forwarded port model

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Base

#attrs=, #call, def_model_attribute, model_attributes, new_from_hash

Constructor Details

#initializeForwardedPort

Returns a new instance of ForwardedPort.



18
19
20
# File 'lib/config_builder/model/network/forwarded_port.rb', line 18

def initialize
  @defaults = {:auto_correct => false}
end

Instance Attribute Details

#auto_correctBoolean

Returns Whether to automatically correct port collisions.

Returns:

  • (Boolean)

    Whether to automatically correct port collisions



16
# File 'lib/config_builder/model/network/forwarded_port.rb', line 16

def_model_attribute :auto_correct

#guestFixnum

Returns The guest port.

Returns:

  • (Fixnum)

    The guest port



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

def_model_attribute :guest

#hostFixnum

Returns The host port.

Returns:

  • (Fixnum)

    The host port



12
# File 'lib/config_builder/model/network/forwarded_port.rb', line 12

def_model_attribute :host

Instance Method Details

#to_procObject



22
23
24
25
26
27
28
29
30
31
# File 'lib/config_builder/model/network/forwarded_port.rb', line 22

def to_proc
  Proc.new do |vm_config|
    vm_config.network(
      :forwarded_port,
      :guest        => attr(:guest),
      :host         => attr(:host),
      :auto_correct => attr(:auto_correct)
    )
  end
end