Class: F2S3::Uploader

Inherits:
Object
  • Object
show all
Defined in:
lib/f2s3/uploader.rb

Instance Method Summary collapse

Constructor Details

#initialize(bucket_name) ⇒ Uploader

Returns a new instance of Uploader.



5
6
7
8
# File 'lib/f2s3/uploader.rb', line 5

def initialize(bucket_name)
  @s3     = Aws::S3::Resource.new
  @bucket = @s3.bucket(bucket_name)
end

Instance Method Details

#upload_file(file_name, bucket_path) ⇒ Object



10
11
12
13
# File 'lib/f2s3/uploader.rb', line 10

def upload_file(file_name, bucket_path)
  @bucket.object(bucket_path)
    .upload_file(file_name)
end