Class: FileWorker::S3UploadWorker
- Inherits:
-
Object
- Object
- FileWorker::S3UploadWorker
- Defined in:
- lib/file_worker/s3_upload_worker.rb
Instance Method Summary collapse
-
#initialize(file_name, options) ⇒ S3UploadWorker
constructor
A new instance of S3UploadWorker.
- #process ⇒ Object
Constructor Details
#initialize(file_name, options) ⇒ S3UploadWorker
Returns a new instance of S3UploadWorker.
5 6 7 8 |
# File 'lib/file_worker/s3_upload_worker.rb', line 5 def initialize(file_name, ) @file_name = file_name @bucket_name = ENV.fetch("S3_BUCKET") end |
Instance Method Details
#process ⇒ Object
10 11 12 |
# File 'lib/file_worker/s3_upload_worker.rb', line 10 def process s3.put(@bucket_name, File.basename(@file_name), File.open(@file_name)) end |