Method: S3::Bucket#destroy
- Defined in:
- lib/s3/bucket.rb
#destroy(force = false) ⇒ Object
Destroys given bucket. Raises an S3::Error::BucketNotEmpty exception if the bucket is not empty. You can destroy non-empty bucket passing true (to force destroy)
66 67 68 69 70 71 72 73 74 75 76 |
# File 'lib/s3/bucket.rb', line 66 def destroy(force = false) delete_bucket true rescue Error::BucketNotEmpty if force objects.destroy_all retry else raise end end |