Class: VagrantPlugins::Skytap::Connection::Choice
- Defined in:
- lib/vagrant-skytap/connection.rb
Overview
A Choice represents the potential for establishing a connection to the guest VM via a specific resource.
Direct Known Subclasses
PublicIpChoice, PublishedServiceChoice, TunnelChoice, VpnChoice
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.
-
#validation_error_message ⇒ Object
readonly
Returns the value of attribute validation_error_message.
Instance Method Summary collapse
-
#choose ⇒ Array
Invokes the execution, and determines the IP address and port for communicating with the guest VM.
-
#initialize(*args) ⇒ Choice
constructor
Thia method should be overridden to call #make on the [Connection::Execution] subclass for this particular resource type.
- #to_s ⇒ Object
-
#valid? ⇒ Boolean
Override this method to add any validation logic needed by a specific resource type.
Constructor Details
#initialize(*args) ⇒ Choice
Thia method should be overridden to call #make on the
- Connection::Execution
-
subclass for this particular resource type.
The execution holds all the information needed to establish the connection.
44 45 46 |
# File 'lib/vagrant-skytap/connection.rb', line 44 def initialize(*args) @env = args.first end |
Instance Attribute Details
#env ⇒ Object (readonly)
Returns the value of attribute env.
38 39 40 |
# File 'lib/vagrant-skytap/connection.rb', line 38 def env @env end |
#execution ⇒ Object (readonly)
Returns the value of attribute execution.
38 39 40 |
# File 'lib/vagrant-skytap/connection.rb', line 38 def execution @execution end |
#iface ⇒ Object (readonly)
Returns the value of attribute iface.
38 39 40 |
# File 'lib/vagrant-skytap/connection.rb', line 38 def iface @iface end |
#validation_error_message ⇒ Object (readonly)
Returns the value of attribute validation_error_message.
38 39 40 |
# File 'lib/vagrant-skytap/connection.rb', line 38 def @validation_error_message end |
Instance Method Details
#choose ⇒ Array
Invokes the execution, and determines the IP address and port for communicating with the guest VM.
53 54 55 |
# File 'lib/vagrant-skytap/connection.rb', line 53 def choose raise NotImplementedError.new('Must override') end |
#to_s ⇒ Object
69 70 71 |
# File 'lib/vagrant-skytap/connection.rb', line 69 def to_s execution. end |
#valid? ⇒ Boolean
Override this method to add any validation logic needed by a specific resource type. For example, [Connection::TunnelChoice] must check for subnet overlaps. If this method returns false, this particular choice should not be offered to the user. For some resource types, it may be useful to set @validation_error_message on this choice when returning false.
65 66 67 |
# File 'lib/vagrant-skytap/connection.rb', line 65 def valid? true end |