Class: VagrantPlugins::Skytap::Connection::PublishedServiceChoice::PublishedServiceExecution

Inherits:
Execution
  • Object
show all
Defined in:
lib/vagrant-skytap/connection/published_service_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, service) ⇒ PublishedServiceExecution

Returns a new instance of PublishedServiceExecution.



63
64
65
66
67
# File 'lib/vagrant-skytap/connection/published_service_choice.rb', line 63

def initialize(env, iface, service)
  @env = env
  @iface = iface
  @service = service
end

Instance Attribute Details

#serviceObject (readonly)

Returns the value of attribute service.



53
54
55
# File 'lib/vagrant-skytap/connection/published_service_choice.rb', line 53

def service
  @service
end

Class Method Details

.make(env, iface, service = nil) ⇒ Object



55
56
57
58
59
60
61
# File 'lib/vagrant-skytap/connection/published_service_choice.rb', line 55

def self.make(env, iface, service=nil)
  if service
    UseExecution.new(env, iface, service)
  else
    CreateAndUseExecution.new(env, iface, service)
  end
end

Instance Method Details

#messageObject



69
70
71
72
73
74
75
# File 'lib/vagrant-skytap/connection/published_service_choice.rb', line 69

def message
  verb.tap do |ret|
    if self.is_a?(UseExecution)
      ret << " #{service.external_ip}:#{service.external_port}"
    end
  end
end