Class: VagrantPlugins::Skytap::Connection::PublicIpChoice

Inherits:
Choice
  • Object
show all
Defined in:
lib/vagrant-skytap/connection/public_ip_choice.rb

Defined Under Namespace

Classes: AttachAndUseExecution, PublicIpAttachmentExecution, UseExecution

Instance Attribute Summary collapse

Attributes inherited from Choice

#env, #execution, #iface, #validation_error_message

Instance Method Summary collapse

Methods inherited from Choice

#to_s, #valid?

Constructor Details

#initialize(env, ip, iface) ⇒ PublicIpChoice

Returns a new instance of PublicIpChoice.



31
32
33
34
35
36
# File 'lib/vagrant-skytap/connection/public_ip_choice.rb', line 31

def initialize(env, ip, iface)
  @env = env
  @ip = ip
  @iface = iface
  @execution = PublicIpAttachmentExecution.make(env, iface, ip)
end

Instance Attribute Details

#ipObject (readonly)

Returns the value of attribute ip.



29
30
31
# File 'lib/vagrant-skytap/connection/public_ip_choice.rb', line 29

def ip
  @ip
end

Instance Method Details

#chooseObject



38
39
40
41
42
43
# File 'lib/vagrant-skytap/connection/public_ip_choice.rb', line 38

def choose
  execution.execute

  host = ip.address
  [host, DEFAULT_PORT]
end