Class: Swa::S3::Bucket

Inherits:
Resource show all
Defined in:
lib/swa/s3/bucket.rb

Instance Attribute Summary

Attributes inherited from Resource

#aws_resource

Instance Method Summary collapse

Methods inherited from Resource

#data, delegate, #initialize, list

Constructor Details

This class inherits a constructor from Swa::Resource

Instance Method Details

#deleteObject



29
30
31
# File 'lib/swa/s3/bucket.rb', line 29

def delete
  bucket.delete
end

#objects(options = {}) ⇒ Object



25
26
27
# File 'lib/swa/s3/bucket.rb', line 25

def objects(options = {})
  Swa::S3::Object.list(aws_resource.objects(options))
end

#policy_dataObject



21
22
23
# File 'lib/swa/s3/bucket.rb', line 21

def policy_data
  MultiJson.load(policy_json)
end

#policy_jsonObject



17
18
19
# File 'lib/swa/s3/bucket.rb', line 17

def policy_json
  bucket.policy.policy.read
end

#summaryObject



9
10
11
# File 'lib/swa/s3/bucket.rb', line 9

def summary
  bucket.name
end

#uriObject



13
14
15
# File 'lib/swa/s3/bucket.rb', line 13

def uri
  "s3://#{bucket.name}"
end