Class: HttpStub::Server::Request::Request
- Inherits:
-
Object
- Object
- HttpStub::Server::Request::Request
- Defined in:
- lib/http_stub/server/request/request.rb
Instance Attribute Summary collapse
-
#body ⇒ Object
readonly
Returns the value of attribute body.
-
#headers ⇒ Object
readonly
Returns the value of attribute headers.
-
#method ⇒ Object
readonly
Returns the value of attribute method.
-
#parameters ⇒ Object
readonly
Returns the value of attribute parameters.
-
#uri ⇒ Object
readonly
Returns the value of attribute uri.
Instance Method Summary collapse
-
#initialize(rack_request) ⇒ Request
constructor
A new instance of Request.
Constructor Details
#initialize(rack_request) ⇒ Request
Returns a new instance of Request.
9 10 11 12 13 14 15 |
# File 'lib/http_stub/server/request/request.rb', line 9 def initialize(rack_request) @uri = rack_request.path_info @method = rack_request.request_method.downcase @headers = HttpStub::Server::Request::Headers.create(rack_request) @parameters = HttpStub::Server::Request::Parameters.create(rack_request) @body = rack_request.body.read end |
Instance Attribute Details
#body ⇒ Object (readonly)
Returns the value of attribute body.
7 8 9 |
# File 'lib/http_stub/server/request/request.rb', line 7 def body @body end |
#headers ⇒ Object (readonly)
Returns the value of attribute headers.
7 8 9 |
# File 'lib/http_stub/server/request/request.rb', line 7 def headers @headers end |
#method ⇒ Object (readonly)
Returns the value of attribute method.
7 8 9 |
# File 'lib/http_stub/server/request/request.rb', line 7 def method @method end |
#parameters ⇒ Object (readonly)
Returns the value of attribute parameters.
7 8 9 |
# File 'lib/http_stub/server/request/request.rb', line 7 def parameters @parameters end |
#uri ⇒ Object (readonly)
Returns the value of attribute uri.
7 8 9 |
# File 'lib/http_stub/server/request/request.rb', line 7 def uri @uri end |