Class: Bosh::Agent::Infrastructure

Inherits:
Object
  • Object
show all
Defined in:
lib/bosh_agent/infrastructure.rb

Defined Under Namespace

Classes: Aws, Dummy, Openstack, Vcloud, Vsphere

Instance Method Summary collapse

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

#infrastructureObject



20
21
22
# File 'lib/bosh_agent/infrastructure.rb', line 20

def infrastructure
  Infrastructure.const_get(@name.capitalize).new
end