Sha256: a3b66c3a900f9d00886daf8f8c4c24d31c778ddf3489998d62a2d6a271b8bd4e

Contents?: true

Size: 589 Bytes

Versions: 64

Compression:

Stored size: 589 Bytes

Contents

module Fog
  module Image

    def self.[](provider)
      self.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 self.providers.include?(provider)
        require "fog/#{provider}/image"
        return Fog::Image.const_get(Fog.providers[provider]).new(attributes)
      end
      raise ArgumentError.new("#{provider} has no identity service")
    end

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

  end
end

Version data entries

64 entries across 64 versions & 7 rubygems

Version Path
fog-1.11.0 lib/fog/image.rb
fog-1.10.1 lib/fog/image.rb
fog-test-me-1.10.0 lib/fog/image.rb
fog-1.10.0 lib/fog/image.rb