Class: Spec::Client::Http::Request

Inherits:
Object
  • Object
show all
Defined in:
lib/spec/client/http/request.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(url, request_method, params, headers, driver = Driver::CurlDriver.new) ⇒ Request

Returns a new instance of Request.



10
11
12
# File 'lib/spec/client/http/request.rb', line 10

def initialize(url, request_method, params, headers, driver=Driver::CurlDriver.new)
  @url, @request_method, @params, @headers, @driver = url, request_method, params, headers, driver
end

Instance Attribute Details

#headersObject

Returns the value of attribute headers.



8
9
10
# File 'lib/spec/client/http/request.rb', line 8

def headers
  @headers
end

#paramsObject

Returns the value of attribute params.



8
9
10
# File 'lib/spec/client/http/request.rb', line 8

def params
  @params
end

#request_methodObject

Returns the value of attribute request_method.



8
9
10
# File 'lib/spec/client/http/request.rb', line 8

def request_method
  @request_method
end

#urlObject

Returns the value of attribute url.



8
9
10
# File 'lib/spec/client/http/request.rb', line 8

def url
  @url
end

Instance Method Details

#driver_execute(url, request_method, headers, params) ⇒ Object



22
23
24
# File 'lib/spec/client/http/request.rb', line 22

def driver_execute(url,request_method,headers,params)
  @driver.execute(url,request_method,headers,params)
end

#executeObject



18
19
20
# File 'lib/spec/client/http/request.rb', line 18

def execute
  driver_execute(url,request_method,headers,params)
end

#url_encoded_paramsObject



14
15
16
# File 'lib/spec/client/http/request.rb', line 14

def url_encoded_params
  @driver.url_encode_params(params)
end