Module: S3::BucketsExtension

Defined in:
lib/s3/buckets_extension.rb

Instance Method Summary collapse

Instance Method Details

#build(name) ⇒ Object

Builds new bucket with given name



4
5
6
# File 'lib/s3/buckets_extension.rb', line 4

def build(name)
  Bucket.send(:new, proxy_owner, name)
end

#destroy_all(force = false) ⇒ Object

Destroys all buckets in the service. Doesn’t destroy non-empty buckets by default, pass true to force destroy (USE WITH CARE!).



22
23
24
# File 'lib/s3/buckets_extension.rb', line 22

def destroy_all(force = false)
  proxy_target.each { |bucket| bucket.destroy(force) }
end

#find_allObject

Finds all buckets in the service



16
17
18
# File 'lib/s3/buckets_extension.rb', line 16

def find_all
  proxy_target
end

#find_first(name) ⇒ Object Also known as: find

Finds the bucket with given name



9
10
11
12
# File 'lib/s3/buckets_extension.rb', line 9

def find_first(name)
  bucket = build(name)
  bucket.retrieve
end