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
Source
# File lib/http/request/body.rb, line 89 def initialize(block) @block = block end
Public Instance Methods
Source
# File lib/http/request/body.rb, line 93 def write(data) @block.call(data) data.bytesize end