Module: VagrantPlugins::Skytap::API::Connectable

Included in:
Network, PublicIp, PublishedService, Vpn
Defined in:
lib/vagrant-skytap/api/connectable.rb

Instance Method Summary collapse

Instance Method Details

#choice_for_setup(*args) ⇒ Connection::Choice

Return a choice object representing the potential to connect via this resource. Arguments depend on resource type.

Returns:



44
45
46
# File 'lib/vagrant-skytap/api/connectable.rb', line 44

def choice_for_setup(*args)
  connection_choice_class.new(env, self, *args)
end

#connection_choice_classClass

Determine the corresponding [Connection::Choice] subclass for this resource type; e.g. for [API::Vpn] this would return [Connection::VpnChoice]. This method may be overridden where the class name varies from this pattern.

Returns:

  • (Class)


35
36
37
38
# File 'lib/vagrant-skytap/api/connectable.rb', line 35

def connection_choice_class
  require "vagrant-skytap/connection/#{self.class.rest_name}_choice"
  Class.const_get("VagrantPlugins::Skytap::Connection::#{self.class.name.split('::').last}Choice")
end