Similar but not compatible with ::CompositeReadIO provided by multipart-post.
# File lib/faraday/upload_io.rb, line 46 def close @ios.each { |io| io.close } end
# File lib/faraday/upload_io.rb, line 50 def ensure_open_and_readable # Rubinius compatibility end
# File lib/faraday/upload_io.rb, line 19 def length @parts.inject(0) { |sum, part| sum + part.length } end
Read from IOs in order until `length` bytes have been received.
# File lib/faraday/upload_io.rb, line 29 def read(length = nil, outbuf = nil) got_result = false outbuf = outbuf ? outbuf.replace("") : "" while io = current_io if result = io.read(length) got_result ||= !result.nil? result.force_encoding("BINARY") if result.respond_to?(:force_encoding) outbuf << result length -= result.length if length break if length == 0 end advance_io end (!got_result && length) ? nil : outbuf end
Generated with the Darkfish Rdoc Generator 2.