Class: Attach::S3::Backend
- Inherits:
-
Backends::Abstract
- Object
- Backends::Abstract
- Attach::S3::Backend
- Defined in:
- lib/attach/s3/backend.rb
Instance Method Summary collapse
Instance Method Details
#delete(attachment) ⇒ Object
24 25 26 27 28 29 |
# File 'lib/attach/s3/backend.rb', line 24 def delete() s3 = setup_s3_request path = () s3.bucket(@config[:bucket]).object(path).delete end |
#read(attachment) ⇒ Object
9 10 11 12 13 14 15 |
# File 'lib/attach/s3/backend.rb', line 9 def read() s3 = setup_s3_request path = () resp = s3.bucket(@config[:bucket]).object(path).get resp.body.read end |
#write(attachment, data) ⇒ Object
17 18 19 20 21 22 |
# File 'lib/attach/s3/backend.rb', line 17 def write(, data) s3 = setup_s3_request path = () s3.bucket(@config[:bucket]).object(path).put(body: .binary) end |