Method: YARD::Server::Commands::Base#not_found

Defined in:
lib/yard/server/commands/base.rb

#not_foundvoid (protected)

This method returns an undefined value.

Sets the body and headers (but not status) for a 404 response. Does nothing if the body is already set.

Since:

  • 0.6.0


174
175
176
177
178
179
# File 'lib/yard/server/commands/base.rb', line 174

def not_found
  return unless body.empty?
  self.body = "Not found: #{request.path}"
  self.headers['Content-Type'] = 'text/plain'
  self.headers['X-Cascade'] = 'pass'
end