Class: Fluent::PluginHelper::HttpServer::Request
- Inherits:
-
Object
- Object
- Fluent::PluginHelper::HttpServer::Request
- Defined in:
- lib/fluent/plugin_helper/http_server/request.rb
Instance Attribute Summary collapse
-
#path ⇒ Object
readonly
Returns the value of attribute path.
-
#query_string ⇒ Object
readonly
Returns the value of attribute query_string.
Instance Method Summary collapse
- #body ⇒ Object
-
#initialize(request) ⇒ Request
constructor
A new instance of Request.
- #query ⇒ Object
Constructor Details
#initialize(request) ⇒ Request
Returns a new instance of Request.
26 27 28 29 30 |
# File 'lib/fluent/plugin_helper/http_server/request.rb', line 26 def initialize(request) @request = request path = request.path @path, @query_string = path.split('?', 2) end |
Instance Attribute Details
#path ⇒ Object (readonly)
Returns the value of attribute path.
24 25 26 |
# File 'lib/fluent/plugin_helper/http_server/request.rb', line 24 def path @path end |
#query_string ⇒ Object (readonly)
Returns the value of attribute query_string.
24 25 26 |
# File 'lib/fluent/plugin_helper/http_server/request.rb', line 24 def query_string @query_string end |
Instance Method Details
#body ⇒ Object
36 37 38 |
# File 'lib/fluent/plugin_helper/http_server/request.rb', line 36 def body @request.body && @request.body.read end |
#query ⇒ Object
32 33 34 |
# File 'lib/fluent/plugin_helper/http_server/request.rb', line 32 def query @query_string && CGI.parse(@query_string) end |