1
0
Fork 0
mirror of https://github.com/fog/fog.git synced 2022-11-09 13:51:43 -05:00
fog--fog/lib/fog/core/compute.rb

33 lines
904 B
Ruby
Raw Normal View History

2010-10-29 19:24:34 -04:00
module Fog
class Storage
def self.new(attributes)
case attributes.delete(:provider)
when 'AWS'
2010-10-29 19:24:34 -04:00
require 'fog/aws'
Fog::AWS::Compute.new(attributes)
when 'Bluebox'
2010-10-29 19:24:34 -04:00
require 'fog/bluebox'
Fog::Bluebox::Compute.new(attributes)
when 'GoGrid'
2010-10-29 19:24:34 -04:00
require 'fog/go_grid'
Fog::GoGrid::Compute.new(attributes)
when 'Linode'
2010-10-29 19:24:34 -04:00
require 'fog/linode'
Fog::Linode::Compute.new(attributes)
when 'NewServers'
2010-10-29 19:24:34 -04:00
require 'fog/new_servers'
Fog::NewServers::Compute.new(attributes)
when 'Rackspace'
2010-10-29 19:24:34 -04:00
require 'fog/rackspace'
Fog::Rackspace::Compute.new(attributes)
when 'Slicehost'
2010-10-29 19:24:34 -04:00
require 'fog/slicehost'
Fog::Slicehost::Compute.new(attributes)
else
raise ArgumentError.new("#{provider} is not a recognized storage provider")
end
end
end
end