Class: OpenAPIParser::RequestOperation::ValidatableResponseBody

Inherits:
Object
  • Object
show all
Defined in:
lib/openapi_parser/request_operation.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#headersObject (readonly)

Returns the value of attribute headers.



72
73
74
# File 'lib/openapi_parser/request_operation.rb', line 72

def headers
  @headers
end

#response_dataObject (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_codeObject (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_typeObject



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