Module: CloudConfig::Providers::ClassMethods

Defined in:
lib/cloud-config/providers.rb

Overview

Class methods for CloudConfig::Providers

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#Provider configurations(configurations) ⇒ Hash<Symbol,ProviderConfig> (readonly)

Returns:



15
# File 'lib/cloud-config/providers.rb', line 15

attr_reader :providers

#providersObject (readonly)

Returns the value of attribute providers.



15
16
17
# File 'lib/cloud-config/providers.rb', line 15

def providers
  @providers
end

Instance Method Details

#provider(provider_name, provider_options = {}) { ... } ⇒ Object

Add a provider to the list of provider configurations.

Parameters:

  • provider_name (Symbol)

    Name of the provider

  • provider_options (Hash<Symbol,Object>) (defaults to: {})

    Options for configuring the provider

Yields:



23
24
25
26
27
28
# File 'lib/cloud-config/providers.rb', line 23

def provider(provider_name, provider_options = {}, &blk)
  provider_config = ProviderConfig.new(provider_name, provider_options)
  provider_config.instance_eval(&blk) if blk
  @providers ||= {}
  @providers[provider_name] = provider_config
end