Sha256: 75d982869551a719e409d69b3dfa79661042ed3ee6ccff007b27f55231a330e1

Contents?: true

Size: 452 Bytes

Versions: 4

Compression:

Stored size: 452 Bytes

Contents

module IOStreams
  module S3
    class Writer
      # Write to AWS S3
      def self.open(uri = nil, bucket: nil, region: nil, key: nil, &block)
        options = uri.nil? ? args : parse_uri(uri).merge(args)
        s3      = region.nil? ? Aws::S3::Resource.new : Aws::S3::Resource.new(region: region)
        object  = s3.bucket(options[:bucket]).object(options[:key])
        object.upload_stream(file_name_or_io, &block)
      end
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
iostreams-0.16.2 lib/io_streams/s3/writer.rb
iostreams-0.16.1 lib/io_streams/s3/writer.rb
iostreams-0.16.0 lib/io_streams/s3/writer.rb
iostreams-0.15.0 lib/io_streams/s3/writer.rb