Class: ApiTester::Request
- Inherits:
-
Object
- Object
- ApiTester::Request
- Defined in:
- lib/api_tester/request.rb
Instance Attribute Summary collapse
-
#body ⇒ Object
readonly
Returns the value of attribute body.
-
#headers ⇒ Object
readonly
Returns the value of attribute headers.
-
#method ⇒ Object
readonly
Returns the value of attribute method.
-
#token ⇒ Object
readonly
Returns the value of attribute token.
Instance Method Summary collapse
-
#initialize ⇒ Request
constructor
A new instance of Request.
- #set_auth_token(token) ⇒ Object
- #set_body(body) ⇒ Object
- #set_headers(headers) ⇒ Object
- #set_method(method) ⇒ Object
Constructor Details
#initialize ⇒ Request
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
#body ⇒ Object (readonly)
Returns the value of attribute body.
3 4 5 |
# File 'lib/api_tester/request.rb', line 3 def body @body end |
#headers ⇒ Object (readonly)
Returns the value of attribute headers.
3 4 5 |
# File 'lib/api_tester/request.rb', line 3 def headers @headers end |
#method ⇒ Object (readonly)
Returns the value of attribute method.
3 4 5 |
# File 'lib/api_tester/request.rb', line 3 def method @method end |
#token ⇒ Object (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 |