lib/ruby_isds/responses/messages/attachment.rb in ruby_isds-0.10.3 vs lib/ruby_isds/responses/messages/attachment.rb in ruby_isds-0.10.4

- old
+ new

@@ -10,12 +10,14 @@ @encoded_content = hash['dmEncodedContent'] @decoded_content = Base64.decode64(@encoded_content) end def download(destination = '/tmp') - File.open("#{destination}/#{@file_name}", 'wb') do |f| + file_destination = "#{destination}/#{@file_name}" + File.open(file_destination, 'wb') do |f| f.write(@decoded_content) end + file_destination end end end end end