mirror of
https://github.com/fog/fog.git
synced 2022-11-09 13:51:43 -05:00
24 lines
608 B
Ruby
24 lines
608 B
Ruby
module Fog
|
|
class Storage
|
|
|
|
def self.new(attributes)
|
|
case provider = attributes.delete(:provider).to_sym
|
|
when :AWS
|
|
require 'fog/aws'
|
|
Fog::AWS::Storage.new(attributes)
|
|
when :Google
|
|
require 'fog/google'
|
|
Fog::Google::Storage.new(attributes)
|
|
when :Local
|
|
require 'fog/local'
|
|
Fog::Local::Storage.new(attributes)
|
|
when :Rackspace
|
|
require 'fog/rackspace'
|
|
Fog::Rackspace::Storage.new(attributes)
|
|
else
|
|
raise ArgumentError.new("#{provider} is not a recognized storage provider")
|
|
end
|
|
end
|
|
|
|
end
|
|
end
|