Class: Midori::CleanRoom
- Inherits:
-
Object
- Object
- Midori::CleanRoom
- Defined in:
- lib/midori/clean_room.rb
Overview
This class is used to be sandbox of requests processing.
Instance Attribute Summary collapse
-
#body ⇒ Object
HTTP response body.
-
#header ⇒ Hash
HTTP response header.
-
#request ⇒ Midori::Request
HTTP request.
-
#status ⇒ Integer
HTTP response code.
Instance Method Summary collapse
-
#initialize(request) ⇒ CleanRoom
constructor
Init a Cleanroom for running.
-
#raw_response ⇒ Midori::Response
Generate response from variables inside
Midori::CleanRoom
.
Constructor Details
#initialize(request) ⇒ CleanRoom
Init a Cleanroom for running
12 13 14 15 16 17 |
# File 'lib/midori/clean_room.rb', line 12 def initialize(request) @status = 200 @header = Midori::Const::DEFAULT_HEADER.clone @body = '' @request = request end |
Instance Attribute Details
#body ⇒ Object
HTTP response body. String could is accepted by default, but could leave for further process with Midori::Middleware
7 8 9 |
# File 'lib/midori/clean_room.rb', line 7 def body @body end |
#header ⇒ Hash
HTTP response header
7 8 9 |
# File 'lib/midori/clean_room.rb', line 7 def header @header end |
#request ⇒ Midori::Request
HTTP request
7 8 9 |
# File 'lib/midori/clean_room.rb', line 7 def request @request end |
#status ⇒ Integer
HTTP response code
7 8 9 |
# File 'lib/midori/clean_room.rb', line 7 def status @status end |
Instance Method Details
#raw_response ⇒ Midori::Response
Generate response from variables inside Midori::CleanRoom
21 22 23 |
# File 'lib/midori/clean_room.rb', line 21 def raw_response Midori::Response.new(status: @status, header: @header, body: @body) end |