Class: Bosh::Bootstrap::Network
- Inherits:
-
Object
- Object
- Bosh::Bootstrap::Network
- Defined in:
- lib/bosh-bootstrap/network.rb
Instance Attribute Summary collapse
-
#provider_client ⇒ Object
readonly
Returns the value of attribute provider_client.
-
#provider_name ⇒ Object
readonly
Returns the value of attribute provider_name.
Instance Method Summary collapse
- #deploy ⇒ Object
-
#initialize(provider_name, provider_client) ⇒ Network
constructor
A new instance of Network.
-
#network_provider ⇒ Object
Attempt to load and instantiate a NetworkProviders class Else return NetworkProviders::Dummy which does nothing.
Constructor Details
#initialize(provider_name, provider_client) ⇒ Network
Returns a new instance of Network.
9 10 11 12 |
# File 'lib/bosh-bootstrap/network.rb', line 9 def initialize(provider_name, provider_client) @provider_name = provider_name @provider_client = provider_client end |
Instance Attribute Details
#provider_client ⇒ Object (readonly)
Returns the value of attribute provider_client.
7 8 9 |
# File 'lib/bosh-bootstrap/network.rb', line 7 def provider_client @provider_client end |
#provider_name ⇒ Object (readonly)
Returns the value of attribute provider_name.
6 7 8 |
# File 'lib/bosh-bootstrap/network.rb', line 6 def provider_name @provider_name end |
Instance Method Details
#deploy ⇒ Object
14 15 16 |
# File 'lib/bosh-bootstrap/network.rb', line 14 def deploy network_provider.perform end |
#network_provider ⇒ Object
Attempt to load and instantiate a NetworkProviders class Else return NetworkProviders::Dummy which does nothing
20 21 22 23 24 25 26 27 28 29 30 |
# File 'lib/bosh-bootstrap/network.rb', line 20 def network_provider @network_provider ||= begin begin require "bosh-bootstrap/network_providers/#{provider_name}" klass = Bosh::Bootstrap::NetworkProviders.provider_class(provider_name) rescue LoadError klass = Bosh::Bootstrap::NetworkProviders.provider_class("dummy") end klass.new(provider_client) end end |