Class: F2S3::Uploader
- Inherits:
-
Object
- Object
- F2S3::Uploader
- Defined in:
- lib/f2s3/uploader.rb
Instance Method Summary collapse
-
#initialize(bucket_name) ⇒ Uploader
constructor
A new instance of Uploader.
- #upload_file(file_name, bucket_path) ⇒ Object
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 |