Class: HttpCapture::HTTPClientRequest
- Defined in:
- lib/httpclient/capture.rb
Instance Attribute Summary collapse
-
#method ⇒ Object
readonly
Returns the value of attribute method.
-
#path ⇒ Object
readonly
Returns the value of attribute path.
-
#uri ⇒ Object
readonly
Returns the value of attribute uri.
Instance Method Summary collapse
-
#initialize(method, uri, query) ⇒ HTTPClientRequest
constructor
A new instance of HTTPClientRequest.
Constructor Details
#initialize(method, uri, query) ⇒ HTTPClientRequest
Returns a new instance of HTTPClientRequest.
30 31 32 33 34 35 36 37 38 39 40 |
# File 'lib/httpclient/capture.rb', line 30 def initialize(method, uri, query) super(nil) @method = method.to_s.upcase @path = uri if query query = Rack::Utils.build_query(query) unless query.is_a?(String) @uri = URI.parse("#{uri}?#{query}") else @uri = uri.is_a?(URI) ? uri : URI.parse(uri) end end |
Instance Attribute Details
#method ⇒ Object (readonly)
Returns the value of attribute method.
28 29 30 |
# File 'lib/httpclient/capture.rb', line 28 def method @method end |
#path ⇒ Object (readonly)
Returns the value of attribute path.
28 29 30 |
# File 'lib/httpclient/capture.rb', line 28 def path @path end |
#uri ⇒ Object (readonly)
Returns the value of attribute uri.
28 29 30 |
# File 'lib/httpclient/capture.rb', line 28 def uri @uri end |