Class: Aws::S3::Bucket

Inherits:
Object
  • Object
show all
Defined in:
aws-sdk-resources/lib/aws-sdk-resources/services/s3/bucket.rb

Instance Method Summary collapse

Instance Method Details

#clear!void

This method returns an undefined value.

Deletes all objects and versioned objects from this bucket

Examples:


bucket.clear!

14
15
16
# File 'aws-sdk-resources/lib/aws-sdk-resources/services/s3/bucket.rb', line 14

def clear!
  object_versions.delete
end

#delete!void

This method returns an undefined value.

Deletes all objects and versioned objects from this bucket and then deletes the bucket.

Examples:


bucket.delete!

26
27
28
29
# File 'aws-sdk-resources/lib/aws-sdk-resources/services/s3/bucket.rb', line 26

def delete!
  clear!
  delete
end

#urlString

Returns the URL for this bucket.

Returns:

  • (String)

    the URL for this bucket.


32
33
34
35
36
37
38
39
40
# File 'aws-sdk-resources/lib/aws-sdk-resources/services/s3/bucket.rb', line 32

def url
  url = URI.parse(client.config.endpoint.to_s)
  if dns_compatible?(url.scheme) && !client.config.force_path_style
    url.host = "#{name}.#{url.host}"
  else
    url.path = "/#{name}"
  end
  url.to_s
end