class Protocol::HTTP::Body::Writable::Output
The output interface for writing chunks to the body.
def close(error = nil)
If an error is given, the error will be used to close the body by invoking {close} with the error. Otherwise, only the write side of the body will be closed.
Close the output stream.
def close(error = nil) @closed = true if error @writable.close(error) else @writable.close_write end end
def closed?
def closed? @closed || @writable.closed? end
def initialize(writable)
Initialize the output with the given writable body.
def initialize(writable) @writable = writable @closed = false end
def write(chunk)
def write(chunk) @writable.write(chunk) end