Class: VagrantPlugins::Skytap::Connection::TunnelChoice::TunnelExecution

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

Direct Known Subclasses

CreateAndUseExecution, UseExecution

Instance Attribute Summary collapse

Attributes inherited from Execution

#env, #iface

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Execution

#execute, #make, #verb

Constructor Details

#initialize(env, iface, host_network) ⇒ TunnelExecution

Returns a new instance of TunnelExecution.



82
83
84
85
86
# File 'lib/vagrant-skytap/connection/tunnel_choice.rb', line 82

def initialize(env, iface, host_network)
  super
  @host_network = host_network
  @guest_network = iface.network
end

Instance Attribute Details

#guest_networkObject (readonly)

Returns the value of attribute guest_network.



72
73
74
# File 'lib/vagrant-skytap/connection/tunnel_choice.rb', line 72

def guest_network
  @guest_network
end

#host_networkObject (readonly)

Returns the value of attribute host_network.



72
73
74
# File 'lib/vagrant-skytap/connection/tunnel_choice.rb', line 72

def host_network
  @host_network
end

Class Method Details

.make(env, iface, host_network) ⇒ Object



74
75
76
77
78
79
80
# File 'lib/vagrant-skytap/connection/tunnel_choice.rb', line 74

def self.make(env, iface, host_network)
  if host_network.try(:connected_to_network?, iface.network)
    UseExecution.new(env, iface, host_network)
  else
    CreateAndUseExecution.new(env, iface, host_network)
  end
end

Instance Method Details

#messageObject



88
89
90
# File 'lib/vagrant-skytap/connection/tunnel_choice.rb', line 88

def message
  "#{verb}: #{host_network.name}"
end