Class: HttpCapture::HTTPClientRequest

Inherits:
Request
  • Object
show all
Defined in:
lib/httpclient/capture.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(method, uri, query) ⇒ 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

#methodObject (readonly)

Returns the value of attribute method


28
29
30
# File 'lib/httpclient/capture.rb', line 28

def method
  @method
end

#pathObject (readonly)

Returns the value of attribute path


28
29
30
# File 'lib/httpclient/capture.rb', line 28

def path
  @path
end

#uriObject (readonly)

Returns the value of attribute uri


28
29
30
# File 'lib/httpclient/capture.rb', line 28

def uri
  @uri
end