Class: Bosh::Agent::Infrastructure
- Defined in:
- lib/bosh_agent/infrastructure.rb
Defined Under Namespace
Classes: Aws, Dummy, Openstack, Vsphere
Instance Method Summary collapse
- #infrastructure ⇒ Object
-
#initialize(infrastructure_name) ⇒ Infrastructure
constructor
A new instance of Infrastructure.
Constructor Details
#initialize(infrastructure_name) ⇒ Infrastructure
Returns a new instance of Infrastructure.
9 10 11 12 13 14 15 16 17 18 |
# File 'lib/bosh_agent/infrastructure.rb', line 9 def initialize(infrastructure_name) @name = infrastructure_name infrastructure = File.join(File.dirname(__FILE__), 'infrastructure', "#{infrastructure_name}.rb") if File.exist?(infrastructure) require infrastructure else raise UnknownInfrastructure, "infrastructure '#{infrastructure_name}' not found" end end |
Instance Method Details
#infrastructure ⇒ Object
20 21 22 |
# File 'lib/bosh_agent/infrastructure.rb', line 20 def infrastructure Infrastructure.const_get(@name.capitalize).new end |