Class: Helmet::Response
- Inherits:
-
Object
- Object
- Helmet::Response
- Defined in:
- lib/helmet/response.rb
Instance Attribute Summary collapse
-
#body ⇒ Object
HTTP response body.
-
#env ⇒ Object
readonly
Request environment.
-
#header ⇒ Object
HTTP response header.
-
#status ⇒ Object
HTTP response status.
Instance Method Summary collapse
-
#format_response ⇒ Array
HTTP response tuple [status, header, body].
-
#initialize(env) ⇒ Response
constructor
A new instance of Response.
Constructor Details
#initialize(env) ⇒ Response
Returns a new instance of Response.
16 17 18 19 20 21 |
# File 'lib/helmet/response.rb', line 16 def initialize(env) @env = env @status = 200 # Default OK! @header = {} @body = '' end |
Instance Attribute Details
#body ⇒ Object
HTTP response body
14 15 16 |
# File 'lib/helmet/response.rb', line 14 def body @body end |
#env ⇒ Object (readonly)
Request environment
5 6 7 |
# File 'lib/helmet/response.rb', line 5 def env @env end |
#header ⇒ Object
HTTP response header
11 12 13 |
# File 'lib/helmet/response.rb', line 11 def header @header end |
#status ⇒ Object
HTTP response status
8 9 10 |
# File 'lib/helmet/response.rb', line 8 def status @status end |
Instance Method Details
#format_response ⇒ Array
Returns HTTP response tuple [status, header, body].
24 25 26 |
# File 'lib/helmet/response.rb', line 24 def format_response [@status, @header, @body] end |