module AWS::Core::Endpoints

Provides a read-only interface to the bundled endpoints.json file.

Public Class Methods

endpoints() click to toggle source
# File lib/aws/core/endpoints.rb, line 28
def endpoints
  @endpoints ||= begin
    JSON.parse(File.read(File.join(AWS::ROOT, 'endpoints.json')))
  end
end
hostname(region, endpoint_prefix) click to toggle source
# File lib/aws/core/endpoints.rb, line 21
def hostname(region, endpoint_prefix)
  region = endpoints["regions"][region] || {}
  endpoint = region[endpoint_prefix] || {}
  endpoint["hostname"]
end

Private Instance Methods

endpoints() click to toggle source
# File lib/aws/core/endpoints.rb, line 28
def endpoints
  @endpoints ||= begin
    JSON.parse(File.read(File.join(AWS::ROOT, 'endpoints.json')))
  end
end
hostname(region, endpoint_prefix) click to toggle source
# File lib/aws/core/endpoints.rb, line 21
def hostname(region, endpoint_prefix)
  region = endpoints["regions"][region] || {}
  endpoint = region[endpoint_prefix] || {}
  endpoint["hostname"]
end