class HTTP::Request::Body::ProcIO

This class provides a “writable IO” wrapper around a proc object, with write simply calling the proc, which we can pass in as the “destination IO” in IO.copy_stream.

Public Class Methods

new(block) click to toggle source
# File lib/http/request/body.rb, line 58
def initialize(block)
  @block = block
end

Public Instance Methods

write(data) click to toggle source
# File lib/http/request/body.rb, line 62
def write(data)
  @block.call(data)
  data.bytesize
end