Class: Net::PTTH::IncomingRequest
- Inherits:
-
Struct
- Object
- Struct
- Net::PTTH::IncomingRequest
- Defined in:
- lib/net/ptth/incoming_request.rb
Instance Attribute Summary collapse
-
#body ⇒ Object
Returns the value of attribute body.
-
#headers ⇒ Object
Returns the value of attribute headers.
-
#method ⇒ Object
Returns the value of attribute method.
-
#path ⇒ Object
Returns the value of attribute path.
Instance Method Summary collapse
Instance Attribute Details
#body ⇒ Object
Returns the value of attribute body
2 3 4 |
# File 'lib/net/ptth/incoming_request.rb', line 2 def body @body end |
#headers ⇒ Object
Returns the value of attribute headers
2 3 4 |
# File 'lib/net/ptth/incoming_request.rb', line 2 def headers @headers end |
#method ⇒ Object
Returns the value of attribute method
2 3 4 |
# File 'lib/net/ptth/incoming_request.rb', line 2 def method @method end |
#path ⇒ Object
Returns the value of attribute path
2 3 4 |
# File 'lib/net/ptth/incoming_request.rb', line 2 def path @path end |
Instance Method Details
#to_env ⇒ Object
3 4 5 6 7 8 9 10 11 12 13 14 |
# File 'lib/net/ptth/incoming_request.rb', line 3 def to_env env = { "PATH_INFO" => path, "SCRIPT_NAME" => "", "rack.input" => StringIO.new(body || ""), "REQUEST_METHOD" => method, } env.tap { |h| h["CONTENT_LENGTH"] = body.length if !body.nil? } env.merge!(headers) if headers end |