2010-12-11 20:01:33 -05:00
|
|
|
class Zerigo < Fog::Bin
|
|
|
|
class << self
|
|
|
|
|
|
|
|
def class_for(key)
|
|
|
|
case key
|
2010-12-21 16:45:53 -05:00
|
|
|
when :dns
|
|
|
|
Fog::Zerigo::DNS
|
2010-12-11 20:01:33 -05:00
|
|
|
else
|
|
|
|
raise ArgumentError, "Unrecognized service: #{key}"
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
def [](service)
|
|
|
|
@@connections ||= Hash.new do |hash, key|
|
2011-01-14 13:41:12 -05:00
|
|
|
hash[key] = case key
|
2011-01-12 20:55:24 -05:00
|
|
|
when :dns
|
|
|
|
Fog::DNS.new(:provider => 'Zerigo')
|
|
|
|
else
|
2011-02-04 11:17:30 -05:00
|
|
|
raise ArgumentError, "Unrecognized service: #{key.inspect}"
|
2011-01-12 20:55:24 -05:00
|
|
|
end
|
2010-12-11 20:01:33 -05:00
|
|
|
end
|
|
|
|
@@connections[service]
|
|
|
|
end
|
|
|
|
|
|
|
|
def services
|
2011-02-04 11:17:30 -05:00
|
|
|
Fog::Zerigo.services
|
2010-12-11 20:01:33 -05:00
|
|
|
end
|
|
|
|
|
|
|
|
end
|
|
|
|
end
|