Class: MLserver::Request
- Inherits:
-
Object
- Object
- MLserver::Request
- Defined in:
- lib/MLserver/request.rb
Instance Attribute Summary collapse
-
#data ⇒ Object
readonly
Returns the value of attribute data.
-
#headers ⇒ Object
readonly
Returns the value of attribute headers.
-
#request ⇒ Object
readonly
Returns the value of attribute request.
Instance Method Summary collapse
- #httpver ⇒ Object
-
#initialize(headers: {}, request:, data: "", client:) ⇒ Request
constructor
A new instance of Request.
- #method ⇒ Object
- #path ⇒ Object
- #respond(response) ⇒ Object
Constructor Details
#initialize(headers: {}, request:, data: "", client:) ⇒ Request
Returns a new instance of Request.
3 4 5 6 7 8 9 10 |
# File 'lib/MLserver/request.rb', line 3 def initialize(headers: {}, request:, data: "", client:) @headers = headers @request = request @data = data @client = client @request_split = @request.split(" ") end |
Instance Attribute Details
#data ⇒ Object (readonly)
Returns the value of attribute data.
29 30 31 |
# File 'lib/MLserver/request.rb', line 29 def data @data end |
#headers ⇒ Object (readonly)
Returns the value of attribute headers.
29 30 31 |
# File 'lib/MLserver/request.rb', line 29 def headers @headers end |
#request ⇒ Object (readonly)
Returns the value of attribute request.
29 30 31 |
# File 'lib/MLserver/request.rb', line 29 def request @request end |
Instance Method Details
#httpver ⇒ Object
20 21 22 |
# File 'lib/MLserver/request.rb', line 20 def httpver @request_split[2] end |
#method ⇒ Object
12 13 14 |
# File 'lib/MLserver/request.rb', line 12 def method @request_split[0].upcase end |
#path ⇒ Object
16 17 18 |
# File 'lib/MLserver/request.rb', line 16 def path @request_split[1] end |