Class: OpenapiRuby::Testing::RequestBuilder
- Inherits:
-
Object
- Object
- OpenapiRuby::Testing::RequestBuilder
- Defined in:
- lib/openapi_ruby/testing/request_builder.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.
-
#params ⇒ Object
readonly
Returns the value of attribute params.
-
#path ⇒ Object
readonly
Returns the value of attribute path.
Instance Method Summary collapse
- #build ⇒ Object
-
#initialize(operation_context, response_context, param_values: {}, header_values: {}, body_value: nil) ⇒ RequestBuilder
constructor
A new instance of RequestBuilder.
Constructor Details
#initialize(operation_context, response_context, param_values: {}, header_values: {}, body_value: nil) ⇒ RequestBuilder
Returns a new instance of RequestBuilder.
8 9 10 11 12 13 14 15 |
# File 'lib/openapi_ruby/testing/request_builder.rb', line 8 def initialize(operation_context, response_context, param_values: {}, header_values: {}, body_value: nil) @operation = operation_context @response = response_context @param_values = deep_stringify(param_values) @header_values = deep_stringify(header_values) @body_value = body_value @method = operation_context.verb.to_sym end |
Instance Attribute Details
#body ⇒ Object (readonly)
Returns the value of attribute body.
6 7 8 |
# File 'lib/openapi_ruby/testing/request_builder.rb', line 6 def body @body end |
#headers ⇒ Object (readonly)
Returns the value of attribute headers.
6 7 8 |
# File 'lib/openapi_ruby/testing/request_builder.rb', line 6 def headers @headers end |
#method ⇒ Object (readonly)
Returns the value of attribute method.
6 7 8 |
# File 'lib/openapi_ruby/testing/request_builder.rb', line 6 def method @method end |
#params ⇒ Object (readonly)
Returns the value of attribute params.
6 7 8 |
# File 'lib/openapi_ruby/testing/request_builder.rb', line 6 def params @params end |
#path ⇒ Object (readonly)
Returns the value of attribute path.
6 7 8 |
# File 'lib/openapi_ruby/testing/request_builder.rb', line 6 def path @path end |
Instance Method Details
#build ⇒ Object
17 18 19 20 21 22 23 |
# File 'lib/openapi_ruby/testing/request_builder.rb', line 17 def build @path = @params = build_query_params @headers = build_headers @body = build_body self end |