Class: TrainPlugins::Vsphere::Connection
- Inherits:
-
Train::Plugins::Transport::BaseConnection
- Object
- Train::Plugins::Transport::BaseConnection
- TrainPlugins::Vsphere::Connection
- Includes:
- Platform
- Defined in:
- lib/train-vsphere/connection.rb
Instance Method Summary collapse
- #authenticate ⇒ Object
-
#initialize(options) ⇒ Connection
constructor
A new instance of Connection.
- #local? ⇒ Boolean
- #uri ⇒ Object
Methods included from Platform
Constructor Details
#initialize(options) ⇒ Connection
Returns a new instance of Connection.
20 21 22 23 24 25 26 |
# File 'lib/train-vsphere/connection.rb', line 20 def initialize() = () super() enable_cache :api_call end |
Instance Method Details
#authenticate ⇒ Object
28 29 30 31 32 33 |
# File 'lib/train-vsphere/connection.rb', line 28 def authenticate return api_client unless cache_enabled?(:api_call) @cache[:api_call][api_client.to_s.to_sym] ||= api_client end |
#local? ⇒ Boolean
44 45 46 |
# File 'lib/train-vsphere/connection.rb', line 44 def local? false end |
#uri ⇒ Object
38 39 40 41 |
# File 'lib/train-vsphere/connection.rb', line 38 def uri #Report vsphere URI "vsphere://#{[:host]}" end |