Class: Fog::Google::Storage

Inherits:
Service
  • Object
show all
Defined in:
lib/fog/google/storage.rb

Defined Under Namespace

Modules: Utils

Constant Summary collapse

GOOGLE_STORAGE_HOST =
"storage.googleapis.com".freeze

Class Method Summary collapse

Class Method Details

.new(options = {}) ⇒ Object



18
19
20
21
22
23
24
25
26
27
28
29
30
31
# File 'lib/fog/google/storage.rb', line 18

def self.new(options = {})
  begin
    fog_creds = Fog.credentials
  rescue StandardError
    fog_creds = nil
  end

  if options.keys.include?(:google_storage_access_key_id) ||
     (!fog_creds.nil? && fog_creds.keys.include?(:google_storage_access_key_id))
    Fog::Google::StorageXML.new(options)
  else
    Fog::Google::StorageJSON.new(options)
  end
end