Class: InstanceSelector::Provider

Inherits:
Object
  • Object
show all
Defined in:
lib/instance_selector/provider.rb

Overview

Provider factory for different cloud APIs

Class Method Summary collapse

Class Method Details

.factory(provider, options = {}) ⇒ Object


6
7
8
9
10
11
12
13
14
15
16
17
18
# File 'lib/instance_selector/provider.rb', line 6

def self.factory(provider, options = {})
  provider = :override if ENV['HOSTS']

  case provider
  when :aws
    Providers::AWS.new(options)
  when :override
    Providers::Override.new(options)
  else
    raise UnsupportedProviderException,
          "#{provider} is not a supported provider"
  end
end