Method: YARD::Server::Commands::Base#redirect

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

#redirect(url) ⇒ Object (protected)

Sets the headers and status code for a redirection to a given URL

Parameters:

  • url (String)

    the URL to redirect to

Raises:

Since:

  • 0.6.0


184
185
186
187
188
# File 'lib/yard/server/commands/base.rb', line 184

def redirect(url)
  headers['Location'] = url
  self.status = 302
  raise FinishRequest
end