Module: N::Response

Included in:
Context
Defined in:
lib/nitro/response.rb

Overview

HTTP Response.

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#response_cookiesObject

The Response cookies.



21
22
23
# File 'lib/nitro/response.rb', line 21

def response_cookies
  @response_cookies
end

#response_headersObject

The Response headers.



17
18
19
# File 'lib/nitro/response.rb', line 17

def response_headers
  @response_headers
end

#statusObject

The Response status.



13
14
15
# File 'lib/nitro/response.rb', line 13

def status
  @status
end

Instance Method Details

Add a cookie to the response. Better use this method to avoid precreating the cookies array for every request.



31
32
33
# File 'lib/nitro/response.rb', line 31

def add_cookie(cookie)
	(@response_cookies ||= []) << cookie
end

#content_type=(ctype) ⇒ Object



23
24
25
# File 'lib/nitro/response.rb', line 23

def content_type=(ctype)
	@response_headers['Content-Type'] = ctype
end