Class: OpenAPIParser::RequestOperation::ValidatableResponseBody
- Inherits:
-
Object
- Object
- OpenAPIParser::RequestOperation::ValidatableResponseBody
- Defined in:
- lib/openapi_parser/request_operation.rb
Instance Attribute Summary collapse
-
#headers ⇒ Object
readonly
Returns the value of attribute headers.
-
#response_data ⇒ Object
readonly
Returns the value of attribute response_data.
-
#status_code ⇒ Object
readonly
Returns the value of attribute status_code.
Instance Method Summary collapse
- #content_type ⇒ Object
-
#initialize(status_code, response_data, headers) ⇒ ValidatableResponseBody
constructor
A new instance of ValidatableResponseBody.
Constructor Details
#initialize(status_code, response_data, headers) ⇒ ValidatableResponseBody
Returns a new instance of ValidatableResponseBody.
74 75 76 77 78 |
# File 'lib/openapi_parser/request_operation.rb', line 74 def initialize(status_code, response_data, headers) @status_code = status_code @response_data = response_data @headers = headers end |
Instance Attribute Details
#headers ⇒ Object (readonly)
Returns the value of attribute headers.
72 73 74 |
# File 'lib/openapi_parser/request_operation.rb', line 72 def headers @headers end |
#response_data ⇒ Object (readonly)
Returns the value of attribute response_data.
72 73 74 |
# File 'lib/openapi_parser/request_operation.rb', line 72 def response_data @response_data end |
#status_code ⇒ Object (readonly)
Returns the value of attribute status_code.
72 73 74 |
# File 'lib/openapi_parser/request_operation.rb', line 72 def status_code @status_code end |
Instance Method Details
#content_type ⇒ Object
80 81 82 83 |
# File 'lib/openapi_parser/request_operation.rb', line 80 def content_type content_type_key = headers.keys.detect { |k| k.casecmp?('Content-Type') } headers[content_type_key].to_s.split(';').first.to_s end |