class Sinatra::Response

rubydoc.info/github/rack/rack/main/Rack/Response/Helpers<br>https://rubydoc.info/github/rack/rack/main/Rack/Response<br>more info:
The response object. See Rack::Response and Rack::Response::Helpers for

def body=(value)

def body=(value)
  value = value.body while Rack::Response === value
  @body = String === value ? [value.to_str] : value
end

def calculate_content_length?

def calculate_content_length?
  headers['content-type'] && !headers['content-length'] && (Array === body)
end

def drop_body?

def drop_body?
  DROP_BODY_RESPONSES.include?(status)
end

def drop_content_info?

def drop_content_info?
  informational? || drop_body?
end

def each

def each
  block_given? ? super : enum_for(:each)
end

def finish

def finish
  result = body
  if drop_content_info?
    headers.delete 'content-length'
    headers.delete 'content-type'
  end
  if drop_body?
    close
    result = []
  end
  if calculate_content_length?
    # if some other code has already set content-length, don't muck with it
    # currently, this would be the static file-handler
    headers['content-length'] = body.map(&:bytesize).reduce(0, :+).to_s
  end
  [status, headers, result]
end