Sha256: 1ac0653fd80108f5278a6135797a87c8d2248b3fa229cabb3f524ed4eb4cac4e

Contents?: true

Size: 676 Bytes

Versions: 12

Compression:

Stored size: 676 Bytes

Contents

module Fog
  module Identity
    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

      unless providers.include?(provider)
        raise ArgumentError, "#{provider} has no identity service"
      end

      require "fog/#{provider}/identity"
      begin
        Fog::Identity.const_get(Fog.providers[provider])
      rescue
        Fog.const_get(Fog.providers[provider])::Identity
      end.new(attributes)
    end

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

Version data entries

12 entries across 12 versions & 2 rubygems

Version Path
fog-core-1.31.1 lib/fog/identity.rb
fog-core-1.31.0 lib/fog/identity.rb
vagrant-cloudstack-1.1.0 vendor/bundle/gems/fog-core-1.30.0/lib/fog/identity.rb
fog-core-1.30.0 lib/fog/identity.rb
fog-core-1.29.0 lib/fog/identity.rb
fog-core-1.28.0 lib/fog/identity.rb
fog-core-1.27.4 lib/fog/identity.rb
fog-core-1.27.3 lib/fog/identity.rb
fog-core-1.27.2 lib/fog/identity.rb
fog-core-1.27.1 lib/fog/identity.rb
fog-core-1.27.0 lib/fog/identity.rb
fog-core-1.25.0 lib/fog/identity.rb