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.
14 15 16 17 |
# File 'lib/predictionio/async_request.rb', line 14 def initialize(path, params = {}) @params = params @path = path end |
Instance Attribute Details
#params ⇒ Object (readonly)
Query parameters, or form data.
10 11 12 |
# File 'lib/predictionio/async_request.rb', line 10 def params @params end |
#path ⇒ Object (readonly)
The path portion of the request URI.
7 8 9 |
# File 'lib/predictionio/async_request.rb', line 7 def path @path end |
Instance Method Details
#qpath ⇒ Object
Returns an URI path with query parameters encoded for HTTP GET requests.
20 21 22 |
# File 'lib/predictionio/async_request.rb', line 20 def qpath "#{@path}?#{URI::encode_www_form(@params)}" end |