Sha256: 96696c2044de85e49879d37424462cfa19c8287acccf6dde3a0a3150a1574144

Contents?: true

Size: 736 Bytes

Versions: 10

Compression:

Stored size: 736 Bytes

Contents

module Fog
  class Storage

    def self.new(attributes)
      attributes = attributes.dup # prevent delete from having side effects
      case provider = attributes[:provider] # attributes.delete(:provider)
      when 'AWS'
        require 'fog/storage/aws'
        Fog::AWS::Storage.new(attributes)
      when 'Google'
        require 'fog/storage/google'
        Fog::Google::Storage.new(attributes)
      when 'Local'
        require 'fog/storage/local'
        Fog::Local::Storage.new(attributes)
      when 'Rackspace'
        require 'fog/storage/rackspace'
        Fog::Rackspace::Storage.new(attributes)
      else
        raise ArgumentError.new("#{provider} is not a recognized storage provider")
      end
    end

  end
end

Version data entries

10 entries across 10 versions & 2 rubygems

Version Path
fog-0.6.0 lib/fog/storage.rb
fog-0.5.3 lib/fog/storage.rb
fog-0.5.2 lib/fog/storage.rb
fog-0.5.1 lib/fog/storage.rb
fog-0.5.0 lib/fog/storage.rb
phpfog-fog-0.4.1.3 lib/fog/storage.rb
phpfog-fog-0.4.1.2 lib/fog/storage.rb
phpfog-fog-0.4.1.1 lib/fog/storage.rb
phpfog-fog-0.4.1 lib/fog/storage.rb
fog-0.4.1 lib/fog/storage.rb