examples/create_transfer.rb in wetransfer-0.4.4 vs examples/create_transfer.rb in wetransfer-0.9.0.beta
- old
+ new
@@ -1,9 +1,9 @@
require_relative 'we_transfer_client'
require 'dotenv'
Dotenv.load
-client = WeTransferClient.new(api_key: ENV.fetch('WT_API_KEY')) # , logger: Logger.new($stderr))
+client = WeTransfer::Client.new(api_key: ENV.fetch('WT_API_KEY'))
transfer = client.create_transfer(name: 'My amazing transfer', description: 'Hi there!') do |builder|
builder.add_file(name: File.basename(__FILE__), io: File.open(__FILE__, 'rb'))
builder.add_file(name: 'amazing.txt', io: StringIO.new('This is unbelievable'))
builder.add_file(name: 'huge.bin', io: File.open('/path/to/local/file.jpg', 'rb'))
builder.add_file_at(path: __FILE__)