Class: PublishedServiceChoice
- Defined in:
- lib/vagrant-skytap/api/published_service.rb
Overview
TODO:NLA Move this to another class, properly namespaced.
Defined Under Namespace
Classes: CreateAndUseServiceExecution, ServiceExecution, UseServiceExecution
Instance Attribute Summary collapse
-
#env ⇒ Object
readonly
Returns the value of attribute env.
-
#execution ⇒ Object
readonly
Returns the value of attribute execution.
-
#iface ⇒ Object
readonly
Returns the value of attribute iface.
-
#service ⇒ Object
readonly
Returns the value of attribute service.
Class Method Summary collapse
Instance Method Summary collapse
- #choose ⇒ Object
-
#initialize(env, iface, service = nil) ⇒ PublishedServiceChoice
constructor
A new instance of PublishedServiceChoice.
- #to_s ⇒ Object
- #valid? ⇒ Boolean
Constructor Details
#initialize(env, iface, service = nil) ⇒ PublishedServiceChoice
Returns a new instance of PublishedServiceChoice.
11 12 13 14 15 16 |
# File 'lib/vagrant-skytap/api/published_service.rb', line 11 def initialize(env, iface, service=nil) @env = env @iface = iface @service = service @execution = ServiceExecution.make(env, iface, service) end |
Instance Attribute Details
#env ⇒ Object (readonly)
Returns the value of attribute env.
5 6 7 |
# File 'lib/vagrant-skytap/api/published_service.rb', line 5 def env @env end |
#execution ⇒ Object (readonly)
Returns the value of attribute execution.
5 6 7 |
# File 'lib/vagrant-skytap/api/published_service.rb', line 5 def execution @execution end |
#iface ⇒ Object (readonly)
Returns the value of attribute iface.
5 6 7 |
# File 'lib/vagrant-skytap/api/published_service.rb', line 5 def iface @iface end |
#service ⇒ Object (readonly)
Returns the value of attribute service.
5 6 7 |
# File 'lib/vagrant-skytap/api/published_service.rb', line 5 def service @service end |
Class Method Details
.uncreated_choice(env, iface) ⇒ Object
7 8 9 |
# File 'lib/vagrant-skytap/api/published_service.rb', line 7 def self.uncreated_choice(env, iface) new(env, iface, nil) end |
Instance Method Details
#choose ⇒ Object
22 23 24 25 26 |
# File 'lib/vagrant-skytap/api/published_service.rb', line 22 def choose execution.execute @service = execution.service [service.external_ip, service.external_port] end |
#to_s ⇒ Object
18 19 20 |
# File 'lib/vagrant-skytap/api/published_service.rb', line 18 def to_s execution. end |
#valid? ⇒ Boolean
28 29 30 |
# File 'lib/vagrant-skytap/api/published_service.rb', line 28 def valid? service.nil? || service.internal_port == 22 #TODO:NLA Use constant end |