Class: S3Streamer::Client
- Inherits:
-
Object
- Object
- S3Streamer::Client
- Defined in:
- lib/s3_streamer/client.rb
Instance Attribute Summary collapse
-
#client ⇒ Object
readonly
Returns the value of attribute client.
Instance Method Summary collapse
-
#initialize(options) ⇒ Client
constructor
A new instance of Client.
- #stream(source_uri, bucket, destination_file, options = {}) ⇒ Object
Constructor Details
#initialize(options) ⇒ Client
Returns a new instance of Client.
10 11 12 |
# File 'lib/s3_streamer/client.rb', line 10 def initialize() @client = Aws::S3::Client.new() end |
Instance Attribute Details
#client ⇒ Object (readonly)
Returns the value of attribute client.
8 9 10 |
# File 'lib/s3_streamer/client.rb', line 8 def client @client end |
Instance Method Details
#stream(source_uri, bucket, destination_file, options = {}) ⇒ Object
14 15 16 17 18 19 20 21 22 |
# File 'lib/s3_streamer/client.rb', line 14 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 |