lib/rsr_group/order.rb in rsr_group-1.8.0 vs lib/rsr_group/order.rb in rsr_group-2.0.1

- old
+ new

@@ -5,21 +5,10 @@ # * Call {#add_recipient} # * Call {#add_item} for each item on the order # * Call {#submit!} to send the order class Order < Base - class ResponseStruct < Struct.new(:success, :message, :data) - - # Simple response object to pass along success/falure/messages of any process - # Usage: - # response = ResponseStruct.new(true) - # response = ResponseStruct.new(false, "You did the wrong thing") - # response = ResponseStruct.new(true, nil, { result: 200 }) - - alias success? success - end - # @param [Hash] options # @option options [String] :merchant_number *required* # @option options [Integer] :sequence_number *required* # @option options [String] :username *required* # @option options [String] :password *required* @@ -96,19 +85,15 @@ connect(@credentials) do |ftp| ftp.chdir(RsrGroup.config.submission_dir) io = StringIO.new(to_txt) begin ftp.storlines("STOR " + filename, io) - success = ftp.nlst.include?(filename) - @response = ResponseStruct.new(success, nil, modified: ftp.mtime(filename), size: ftp.size(filename)) ensure io.close end ftp.close end - @response || ResponseStruct.new(false) - rescue Net::FTPPermError => e - return ResponseStruct.new(false, e.message.chomp) + true end private def header