Class: FileWorker::S3UploadWorker

Inherits:
Object
  • Object
show all
Defined in:
lib/file_worker/s3_upload_worker.rb

Instance Method Summary collapse

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, options)
  @file_name   = file_name
  @bucket_name = ENV.fetch("S3_BUCKET")
end

Instance Method Details

#processObject



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