Module: N::Response
- Included in:
- Context
- Defined in:
- lib/nitro/response.rb
Overview
HTTP Response.
Instance Attribute Summary collapse
-
#response_cookies ⇒ Object
The Response cookies.
-
#response_headers ⇒ Object
The Response headers.
-
#status ⇒ Object
The Response status.
Instance Method Summary collapse
-
#add_cookie(cookie) ⇒ Object
(also: #send_cookie)
Add a cookie to the response.
- #content_type=(ctype) ⇒ Object
Instance Attribute Details
#response_cookies ⇒ Object
The Response cookies.
21 22 23 |
# File 'lib/nitro/response.rb', line 21 def @response_cookies end |
#response_headers ⇒ Object
The Response headers.
17 18 19 |
# File 'lib/nitro/response.rb', line 17 def response_headers @response_headers end |
#status ⇒ Object
The Response status.
13 14 15 |
# File 'lib/nitro/response.rb', line 13 def status @status end |
Instance Method Details
#add_cookie(cookie) ⇒ Object Also known as:
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 () (@response_cookies ||= []) << 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 |