Sha256: 74430d024cd70ce7cf911fd06ac6912f55920bc57d63e708bb50db57abf580b7

Contents?: true

Size: 612 Bytes

Versions: 7

Compression:

Stored size: 612 Bytes

Contents

module Fog
  module Orchestration
    def self.[](provider)
      new(:provider => provider)
    end

    def self.new(attributes)
      attributes = attributes.dup # Prevent delete from having side effects
      provider = attributes.delete(:provider).to_s.downcase.to_sym

      if providers.include?(provider)
        require "fog/#{provider}/orchestration"
        return Fog::Orchestration.const_get(Fog.providers[provider]).new(attributes)
      end

      raise ArgumentError, "#{provider} has no orchestration service"
    end

    def self.providers
      Fog.services[:orchestration]
    end
  end
end

Version data entries

7 entries across 7 versions & 2 rubygems

Version Path
vagrant-cloudstack-1.1.0 vendor/bundle/gems/fog-core-1.30.0/lib/fog/orchestration.rb
fog-core-1.30.0 lib/fog/orchestration.rb
fog-core-1.29.0 lib/fog/orchestration.rb
fog-core-1.28.0 lib/fog/orchestration.rb
fog-core-1.27.4 lib/fog/orchestration.rb
fog-core-1.27.3 lib/fog/orchestration.rb
fog-core-1.27.2 lib/fog/orchestration.rb