Method: RightAws::S3#buckets

Defined in:
lib/s3/right_s3.rb

#bucketsObject

Retrieve a list of buckets. Returns an array of RightAws::S3::Bucket instances.

# Create handle to S3 account
s3 = RightAws::S3.new(aws_access_key_id, aws_secret_access_key)
my_buckets_names = s3.buckets.map{|b| b.name}
puts "Buckets on S3: #{my_bucket_names.join(', ')}"


73
74
75
76
77
78
# File 'lib/s3/right_s3.rb', line 73

def buckets
  @interface.list_all_my_buckets.map! do |entry|
    owner = Owner.new(entry[:owner_id], entry[:owner_display_name])
    Bucket.new(self, entry[:name], entry[:creation_date], owner)
  end
end