# class WebConsole::Response

A response object that writes content before the closing </body> tag, if possible.

The object quacks like Rack::Response.

### Public Instance Methods

finish() click to toggle source

    # File lib/web_console/response.rb, line 19
    def finish
      Rack::Response.new(body, status, headers).finish
    end

write(content) click to toggle source

    # File lib/web_console/response.rb, line 7
    def write(content)
      raw_body = Array(body).first.to_s

      if position = raw_body.rindex('</body>')
        raw_body.insert(position, content)
      else
        raw_body << content
      end

      self.body = raw_body
    end