Class: ApiTester::Request

Inherits:
Object
  • Object
show all
Defined in:
lib/api_tester/request.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeRequest

Returns a new instance of Request.



5
6
7
8
9
10
# File 'lib/api_tester/request.rb', line 5

def initialize
  @headers = {}
  @method = 'GET'
  @body = nil
  @token = nil
end

Instance Attribute Details

#bodyObject (readonly)

Returns the value of attribute body.



3
4
5
# File 'lib/api_tester/request.rb', line 3

def body
  @body
end

#headersObject (readonly)

Returns the value of attribute headers.



3
4
5
# File 'lib/api_tester/request.rb', line 3

def headers
  @headers
end

#methodObject (readonly)

Returns the value of attribute method.



3
4
5
# File 'lib/api_tester/request.rb', line 3

def method
  @method
end

#tokenObject (readonly)

Returns the value of attribute token.



3
4
5
# File 'lib/api_tester/request.rb', line 3

def token
  @token
end

Instance Method Details

#set_auth_token(token) ⇒ Object



24
25
26
# File 'lib/api_tester/request.rb', line 24

def set_auth_token(token)
  @token = token
end

#set_body(body) ⇒ Object



20
21
22
# File 'lib/api_tester/request.rb', line 20

def set_body(body)
  @body = body
end

#set_headers(headers) ⇒ Object



12
13
14
# File 'lib/api_tester/request.rb', line 12

def set_headers(headers)
  @headers = headers
end

#set_method(method) ⇒ Object



16
17
18
# File 'lib/api_tester/request.rb', line 16

def set_method(method)
  @method = method.upcase
end