Class: Opsicle::S3Bucket
- Inherits:
-
Object
- Object
- Opsicle::S3Bucket
- Defined in:
- lib/opsicle/s3_bucket.rb
Instance Attribute Summary collapse
-
#bucket ⇒ Object
readonly
Returns the value of attribute bucket.
Instance Method Summary collapse
-
#initialize(client, bucket_name) ⇒ S3Bucket
constructor
A new instance of S3Bucket.
- #update(object) ⇒ Object
Constructor Details
#initialize(client, bucket_name) ⇒ S3Bucket
Returns a new instance of S3Bucket.
7 8 9 10 |
# File 'lib/opsicle/s3_bucket.rb', line 7 def initialize(client, bucket_name) @bucket = client.s3.buckets[bucket_name] raise UnknownBucket unless @bucket.exists? end |
Instance Attribute Details
#bucket ⇒ Object (readonly)
Returns the value of attribute bucket.
5 6 7 |
# File 'lib/opsicle/s3_bucket.rb', line 5 def bucket @bucket end |
Instance Method Details
#update(object) ⇒ Object
12 13 14 15 |
# File 'lib/opsicle/s3_bucket.rb', line 12 def update(object) obj = bucket.objects[object] obj.write(Pathname.new(object)) end |