Class: PredictionIO::AsyncRequest
- Inherits:
-
Object
- Object
- PredictionIO::AsyncRequest
- Defined in:
- lib/predictionio/async_request.rb
Overview
This class contains the URI path and query parameters that is consumed by PredictionIO::Connection for asynchronous HTTP requests.
Instance Attribute Summary collapse
-
#params ⇒ Object
readonly
Query parameters, or form data.
-
#path ⇒ Object
readonly
The path portion of the request URI.
Instance Method Summary collapse
-
#initialize(path, params = {}) ⇒ AsyncRequest
constructor
Populates the package with request URI path, and optionally query parameters or form data.
-
#qpath ⇒ Object
Returns an URI path with query parameters encoded for HTTP GET requests.
Constructor Details
#initialize(path, params = {}) ⇒ AsyncRequest
Populates the package with request URI path, and optionally query parameters or form data.
29 30 31 32 |
# File 'lib/predictionio/async_request.rb', line 29 def initialize(path, params = {}) @params = params @path = path end |
Instance Attribute Details
#params ⇒ Object (readonly)
Query parameters, or form data.
25 26 27 |
# File 'lib/predictionio/async_request.rb', line 25 def params @params end |
#path ⇒ Object (readonly)
The path portion of the request URI.
22 23 24 |
# File 'lib/predictionio/async_request.rb', line 22 def path @path end |
Instance Method Details
#qpath ⇒ Object
Returns an URI path with query parameters encoded for HTTP GET requests.
35 36 37 |
# File 'lib/predictionio/async_request.rb', line 35 def qpath "#{@path}?#{URI::encode_www_form(@params)}" end |