Class: ApiTester::Method
- Inherits:
-
Object
- Object
- ApiTester::Method
- Defined in:
- lib/api-tester/definition/method.rb
Overview
Class for defining methods as part of an endpoint
Instance Attribute Summary collapse
-
#expected_response ⇒ Object
Returns the value of attribute expected_response.
-
#request ⇒ Object
Returns the value of attribute request.
-
#verb ⇒ Object
Returns the value of attribute verb.
Instance Method Summary collapse
- #default_request ⇒ Object
-
#initialize(verb:, response:, request:) ⇒ Method
constructor
A new instance of Method.
Constructor Details
#initialize(verb:, response:, request:) ⇒ Method
Returns a new instance of Method.
8 9 10 11 12 |
# File 'lib/api-tester/definition/method.rb', line 8 def initialize(verb:, response:, request:) self.verb = verb self.request = request self.expected_response = response end |
Instance Attribute Details
#expected_response ⇒ Object
Returns the value of attribute expected_response.
6 7 8 |
# File 'lib/api-tester/definition/method.rb', line 6 def expected_response @expected_response end |
#request ⇒ Object
Returns the value of attribute request.
6 7 8 |
# File 'lib/api-tester/definition/method.rb', line 6 def request @request end |
#verb ⇒ Object
Returns the value of attribute verb.
6 7 8 |
# File 'lib/api-tester/definition/method.rb', line 6 def verb @verb end |
Instance Method Details
#default_request ⇒ Object
14 15 16 17 18 |
# File 'lib/api-tester/definition/method.rb', line 14 def default_request { method: verb, payload: request.default_payload, headers: request.default_headers } end |