2010-09-24 16:12:01 -04:00
|
|
|
class Google < Fog::Bin
|
2010-09-18 13:40:48 -04:00
|
|
|
class << self
|
|
|
|
|
2010-12-06 22:49:58 -05:00
|
|
|
def class_for(key)
|
|
|
|
case key
|
|
|
|
when :storage
|
|
|
|
Fog::Google::Storage
|
|
|
|
else
|
|
|
|
raise ArgumentError, "Unsupported #{self} service: #{key}"
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
2010-09-24 16:12:01 -04:00
|
|
|
def [](service)
|
|
|
|
@@connections ||= Hash.new do |hash, key|
|
2010-12-06 22:49:58 -05:00
|
|
|
hash[key] = class_for(key).new
|
2010-09-18 13:40:48 -04:00
|
|
|
end
|
2010-09-24 16:12:01 -04:00
|
|
|
@@connections[service]
|
|
|
|
end
|
2010-09-18 13:40:48 -04:00
|
|
|
|
2010-09-24 16:12:01 -04:00
|
|
|
def services
|
|
|
|
[:storage]
|
2010-09-18 13:40:48 -04:00
|
|
|
end
|
2010-09-24 16:12:01 -04:00
|
|
|
|
2010-09-18 13:40:48 -04:00
|
|
|
end
|
|
|
|
end
|