class Roda::RodaPlugins::Streaming::Stream
Class of the response body in case you use #stream.
def <<(data)
def <<(data) write(data) self end
def close
If not already closed, close the connection, and call
def close return if closed? @closed = true @callback.call if @callback end
def closed?
def closed? @closed end
def each(&out)
def each(&out) @out = out @block.call(self) ensure close end
def initialize(opts=OPTS, &block)
def initialize(opts=OPTS, &block) @block = block @out = nil @callback = opts[:callback] @closed = false end
def write(data)
def write(data) data = data.to_s @out.call(data) data.bytesize end