Class: ConfigBuilder::Model::Network::ForwardedPort
- Defined in:
- lib/config_builder/model/network/forwarded_port.rb
Overview
Vagrant forwarded port model
Instance Attribute Summary collapse
-
#auto_correct ⇒ Boolean
Whether to automatically correct port collisions.
-
#guest ⇒ Fixnum
The guest port.
-
#host ⇒ Fixnum
The host port.
-
#id ⇒ String?
An optional name used to identify this port forward.
Instance Method Summary collapse
-
#initialize ⇒ ForwardedPort
constructor
A new instance of ForwardedPort.
- #to_proc ⇒ Object
Methods inherited from Base
#attrs=, #call, def_model_attribute, model_attributes, new_from_hash
Constructor Details
#initialize ⇒ ForwardedPort
Returns a new instance of ForwardedPort.
22 23 24 |
# File 'lib/config_builder/model/network/forwarded_port.rb', line 22 def initialize @defaults = {:auto_correct => false, :id => nil} end |
Instance Attribute Details
#auto_correct ⇒ Boolean
Returns Whether to automatically correct port collisions.
16 |
# File 'lib/config_builder/model/network/forwarded_port.rb', line 16 def_model_attribute :auto_correct |
#guest ⇒ Fixnum
Returns The guest port.
8 |
# File 'lib/config_builder/model/network/forwarded_port.rb', line 8 def_model_attribute :guest |
#host ⇒ Fixnum
Returns The host port.
12 |
# File 'lib/config_builder/model/network/forwarded_port.rb', line 12 def_model_attribute :host |
#id ⇒ String?
Returns An optional name used to identify this port forward.
20 |
# File 'lib/config_builder/model/network/forwarded_port.rb', line 20 def_model_attribute :id |
Instance Method Details
#to_proc ⇒ Object
26 27 28 29 30 31 32 33 34 35 36 |
# File 'lib/config_builder/model/network/forwarded_port.rb', line 26 def to_proc Proc.new do |vm_config| vm_config.network( :forwarded_port, :guest => attr(:guest), :host => attr(:host), :auto_correct => attr(:auto_correct), :id => attr(:id), ) end end |