Class: Racket::Response

Inherits:
Rack::Response
  • Object
show all
Defined in:
lib/racket/response.rb

Overview

Represents a response from the application

Class Method Summary collapse

Class Method Details

.generate_error_response(status) ⇒ Array

Generates a basic error response.

Parameters:

  • status (Fixnum)

Returns:

  • (Array)


26
27
28
29
30
# File 'lib/racket/response.rb', line 26

def self.generate_error_response(status)
  response = new([], status, 'Content-Type' => 'text/plain')
  response.write("#{status} #{Rack::Utils::HTTP_STATUS_CODES[status]}")
  response.finish
end