Module: Aws::S3::PublicUrl Private

Defined in:
lib/aws-sdk-resources/services/s3/public_url.rb

This module is part of a private API. You should avoid using this module if possible, as it may be removed or be changed in the future.

Class Method Summary collapse

Class Method Details

.build(options = {}) ⇒ String

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Parameters:

  • options (Hash) (defaults to: {})

    a customizable set of options

Options Hash (options):

  • :endpoint (required, URI::HTTP, URI::HTTPS)

    The Amazon S3 endpoint to generate the public URL against.

  • :bucket_name (required, String)

    Name of the bucket the object is in.

  • :object_key (required, String)

    Key of the object to generate a URL for.

  • :force_path_style (Boolean) — default: false

    When ‘true`, the bucket name will always be part of the URI path. When `false`, DNS compatible bucket names will be the endpoint host subdomain.

    # path style
    "https://s3.amazonaws.com/bucket-name/key"
    
    # dns-style
    "https://bucket-name.s3.amazonaws.com/key"
    

Returns:

  • (String)


27
28
29
30
31
32
# File 'lib/aws-sdk-resources/services/s3/public_url.rb', line 27

def build(options = {})
  endpoint = options[:endpoint].dup
  apply_bucket_name(endpoint, options)
  apply_object_key(endpoint, options)
  endpoint.to_s
end