Module: Inception::Providers
- Extended by:
- Providers
- Included in:
- Providers
- Defined in:
- lib/inception/providers.rb,
lib/inception/providers/constants/aws_constants.rb,
lib/inception/providers/clients/aws_provider_client.rb,
lib/inception/providers/clients/fog_provider_client.rb,
lib/inception/providers/constants/openstack_constants.rb,
lib/inception/providers/clients/openstack_provider_client.rb
Defined Under Namespace
Instance Method Summary collapse
-
#provider_client(attributes) ⇒ Object
returns a BOSH provider (CPI) specific object with helpers related to that provider returns nil if
provider_name
is unknown.
Instance Method Details
#provider_client(attributes) ⇒ Object
returns a BOSH provider (CPI) specific object with helpers related to that provider returns nil if provider_name
is unknown
11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 |
# File 'lib/inception/providers.rb', line 11 def provider_client(attributes) attributes = attributes.is_a?(Hash) ? ReadWriteSettings.new(attributes) : attributes case attributes.name.to_sym when :aws @aws_provider_client ||= begin require "inception/providers/clients/aws_provider_client" Inception::Providers::Clients::AwsProviderClient.new(attributes) end when :openstack @openstack_provider_client ||= begin require "inception/providers/clients/openstack_provider_client" Inception::Providers::Clients::OpenStackProviderClient.new(attributes) end else nil end end |