Class: Cannon::Request
- Inherits:
-
Object
- Object
- Cannon::Request
- Defined in:
- lib/cannon/request.rb
Instance Attribute Summary collapse
-
#content_type ⇒ Object
Returns the value of attribute content_type.
-
#headers ⇒ Object
Returns the value of attribute headers.
-
#http_cookie ⇒ Object
Returns the value of attribute http_cookie.
-
#method ⇒ Object
Returns the value of attribute method.
-
#path ⇒ Object
Returns the value of attribute path.
-
#post_content ⇒ Object
Returns the value of attribute post_content.
-
#protocol ⇒ Object
Returns the value of attribute protocol.
-
#query_string ⇒ Object
Returns the value of attribute query_string.
-
#start_time ⇒ Object
Returns the value of attribute start_time.
-
#uri ⇒ Object
Returns the value of attribute uri.
Instance Method Summary collapse
-
#initialize(http_server, app) ⇒ Request
constructor
A new instance of Request.
- #params ⇒ Object
Constructor Details
#initialize(http_server, app) ⇒ Request
Returns a new instance of Request.
8 9 10 11 12 13 14 15 16 17 18 19 |
# File 'lib/cannon/request.rb', line 8 def initialize(http_server, app) self.protocol = http_server.instance_variable_get('@http_protocol') self.method = http_server.instance_variable_get('@http_request_method') self. = http_server.instance_variable_get('@http_cookie') self.content_type = http_server.instance_variable_get('@http_content_type') self.path = http_server.instance_variable_get('@http_path_info') self.uri = http_server.instance_variable_get('@http_request_uri') self.query_string = http_server.instance_variable_get('@http_query_string') self.post_content = http_server.instance_variable_get('@http_post_content') self.headers = http_server.instance_variable_get('@http_headers') self.start_time = Time.now end |
Instance Attribute Details
#content_type ⇒ Object
Returns the value of attribute content_type.
5 6 7 |
# File 'lib/cannon/request.rb', line 5 def content_type @content_type end |
#headers ⇒ Object
Returns the value of attribute headers.
5 6 7 |
# File 'lib/cannon/request.rb', line 5 def headers @headers end |
#http_cookie ⇒ Object
Returns the value of attribute http_cookie.
5 6 7 |
# File 'lib/cannon/request.rb', line 5 def @http_cookie end |
#method ⇒ Object
Returns the value of attribute method.
5 6 7 |
# File 'lib/cannon/request.rb', line 5 def method @method end |
#path ⇒ Object
Returns the value of attribute path.
5 6 7 |
# File 'lib/cannon/request.rb', line 5 def path @path end |
#post_content ⇒ Object
Returns the value of attribute post_content.
5 6 7 |
# File 'lib/cannon/request.rb', line 5 def post_content @post_content end |
#protocol ⇒ Object
Returns the value of attribute protocol.
5 6 7 |
# File 'lib/cannon/request.rb', line 5 def protocol @protocol end |
#query_string ⇒ Object
Returns the value of attribute query_string.
5 6 7 |
# File 'lib/cannon/request.rb', line 5 def query_string @query_string end |
#start_time ⇒ Object
Returns the value of attribute start_time.
5 6 7 |
# File 'lib/cannon/request.rb', line 5 def start_time @start_time end |
#uri ⇒ Object
Returns the value of attribute uri.
5 6 7 |
# File 'lib/cannon/request.rb', line 5 def uri @uri end |
Instance Method Details
#params ⇒ Object
21 22 23 |
# File 'lib/cannon/request.rb', line 21 def params @params ||= parse_params end |