class ActionDispatch::Response::Buffer
:nodoc:
def abort
def abort end
def body
def body @str_body ||= begin buf = +"" each { |chunk| buf << chunk } buf end end
def close
def close @response.commit! @closed = true end
def closed?
def closed? @closed end
def each(&block)
def each(&block) if @str_body return enum_for(:each) unless block_given? yield @str_body else each_chunk(&block) end end
def each_chunk(&block)
def each_chunk(&block) @buf.each(&block) end
def initialize(response, buf)
def initialize(response, buf) @response = response @buf = buf @closed = false @str_body = nil end
def write(string)
def write(string) raise IOError, "closed stream" if closed? @str_body = nil @response.commit! @buf.push string end