Class: S3Streamer::Client
- Inherits:
-
Object
- Object
- S3Streamer::Client
- Defined in:
- lib/s3_streamer/client.rb
Instance Method Summary collapse
-
#initialize(options) ⇒ Client
constructor
A new instance of Client.
- #stream(source_uri, bucket, destination_file) ⇒ Object
Constructor Details
#initialize(options) ⇒ Client
Returns a new instance of Client.
8 9 10 |
# File 'lib/s3_streamer/client.rb', line 8 def initialize() @client = Aws::S3::Client.new() end |
Instance Method Details
#stream(source_uri, bucket, destination_file) ⇒ Object
12 13 14 15 16 17 18 19 20 |
# File 'lib/s3_streamer/client.rb', line 12 def stream(source_uri, bucket, destination_file) upstream = Upstream.new @client, bucket, destination_file Downstream.new(URI(source_uri)).each do |chunk| upstream.upload chunk end upstream.complete end |