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/google/bin.rb

42 lines
755 B
Ruby
Raw Normal View History

module Google
class << self
if Fog.credentials[:google_storage_access_key_id] && Fog.credentials[:google_storage_secret_access_key]
def initialized?
true
end
def [](service)
@@connections ||= Hash.new do |hash, key|
hash[key] = case key
when :storage
Fog::Google::Storage.new
end
end
@@connections[service]
end
def services
[:storage]
end
for collection in Fog::Google::Storage.collections
module_eval <<-EOS, __FILE__, __LINE__
def #{collection}
self[:storage].#{collection}
end
EOS
end
else
def initialized?
false
end
end
end
end