Class: Cocaine::Http::Response

Inherits:
Object
  • Object
show all
Defined in:
lib/cocaine/server/http.rb

Instance Method Summary collapse

Constructor Details

#initialize(response) ⇒ Response

Returns a new instance of Response.



33
34
35
# File 'lib/cocaine/server/http.rb', line 33

def initialize(response)
  @response = response
end

Instance Method Details

#body=(body) ⇒ Object



41
42
43
# File 'lib/cocaine/server/http.rb', line 41

def body=(body)
  @response.write body
end

#closeObject



49
50
51
# File 'lib/cocaine/server/http.rb', line 49

def close
  @response.close
end

#error(errno, reason) ⇒ Object



45
46
47
# File 'lib/cocaine/server/http.rb', line 45

def error(errno, reason)
  @response.error errno, reason
end

#write_headers(code, headers) ⇒ Object



37
38
39
# File 'lib/cocaine/server/http.rb', line 37

def write_headers(code, headers)
  @response.write [code, headers]
end