Class/Module Index [+]

Quicksearch

Fog::Storage::Atmos::Utils

Constants

ENDPOINT_REGEX

Public Instance Methods

api_path() click to toggle source
# File lib/fog/atmos/storage.rb, line 49
def api_path
  @endpoint.match(ENDPOINT_REGEX)[4]
end
host() click to toggle source
# File lib/fog/atmos/storage.rb, line 45
def host
  @endpoint.match(ENDPOINT_REGEX)[2]
end
port() click to toggle source
# File lib/fog/atmos/storage.rb, line 39
def port
  port = @endpoint.match(ENDPOINT_REGEX)[3]
  return ssl? ? 443 : 80 if port.nil?
  port.split(':')[1].to_i
end
setup_credentials(options) click to toggle source
# File lib/fog/atmos/storage.rb, line 53
def setup_credentials(options)
  @storage_token = options[:atmos_storage_token]
  @storage_secret = options[:atmos_storage_secret]
  @storage_secret_decoded = Base64.decode64(@storage_secret)
  @endpoint = options[:atmos_storage_endpoint]
  @prefix = self.ssl? ? 'https' : 'http'
  @storage_host = self.host
  @storage_port = self.port
  @api_path = self.api_path
end
ssl?() click to toggle source
# File lib/fog/atmos/storage.rb, line 29
def ssl?
  protocol = @endpoint.match(ENDPOINT_REGEX)[1]
  raise ArgumentError, 'Invalid endpoint URL' if protocol.nil?

  return true if protocol == 'https'
  return false if protocol == 'http'

  raise ArgumentError, "Unknown protocol #{protocol}"
end

[Validate]

Generated with the Darkfish Rdoc Generator 2.