Module: Souffle::Provider

Defined in:
lib/souffle/provider.rb

Overview

A metal provider module (Describes AWS, Softlayer, etc).

Defined Under Namespace

Classes: AWS, Base, Vagrant

Class Method Summary collapse

Class Method Details

.plugin(name) ⇒ Souffle::Provider::Base

Returns the plugin with the given name.

Parameters:

  • name (String)

    The name of the plugin to select.

Returns:



19
20
21
22
23
24
# File 'lib/souffle/provider.rb', line 19

def plugin(name)
  plug = constants.select { |k| k.to_s.downcase == name.downcase }.first
  Souffle::Provider.const_get(plug)
rescue Souffle::Exceptions::PluginDoesNotExist => e
  Souffle::Log.error "#{e.message}:\n#{e.backtrace.join("\n")}"
end

.pluginsArray

Returns the list of available provider plugins.

Returns:

  • (Array)

    The list of available provider plugins.



10
11
12
# File 'lib/souffle/provider.rb', line 10

def plugins
  constants.map { |k| k.to_s.downcase }
end