Class: VagrantPlugins::Skytap::Connection::PublishedServiceChoice
- Defined in:
- lib/vagrant-skytap/connection/published_service_choice.rb
Defined Under Namespace
Classes: CreateAndUseExecution, PublishedServiceExecution, UseExecution
Instance Attribute Summary collapse
-
#service ⇒ Object
readonly
Returns the value of attribute service.
Attributes inherited from Choice
#env, #execution, #iface, #validation_error_message
Class Method Summary collapse
Instance Method Summary collapse
- #choose ⇒ Object
-
#initialize(env, iface, service = nil) ⇒ PublishedServiceChoice
constructor
A new instance of PublishedServiceChoice.
- #valid? ⇒ Boolean
Methods inherited from Choice
Constructor Details
#initialize(env, iface, service = nil) ⇒ PublishedServiceChoice
Returns a new instance of PublishedServiceChoice.
35 36 37 38 39 40 |
# File 'lib/vagrant-skytap/connection/published_service_choice.rb', line 35 def initialize(env, iface, service=nil) @env = env @iface = iface @service = service @execution = PublishedServiceExecution.make(env, iface, service) end |
Instance Attribute Details
#service ⇒ Object (readonly)
Returns the value of attribute service.
29 30 31 |
# File 'lib/vagrant-skytap/connection/published_service_choice.rb', line 29 def service @service end |
Class Method Details
.uncreated_choice(env, iface) ⇒ Object
31 32 33 |
# File 'lib/vagrant-skytap/connection/published_service_choice.rb', line 31 def self.uncreated_choice(env, iface) new(env, iface, nil) end |
Instance Method Details
#choose ⇒ Object
42 43 44 45 46 |
# File 'lib/vagrant-skytap/connection/published_service_choice.rb', line 42 def choose execution.execute @service = execution.service [service.external_ip, service.external_port] end |
#valid? ⇒ Boolean
48 49 50 |
# File 'lib/vagrant-skytap/connection/published_service_choice.rb', line 48 def valid? service.nil? || service.internal_port == DEFAULT_PORT end |