Class: OpenapiFirst::Definition::Response

Inherits:
Object
  • Object
show all
Defined in:
lib/openapi_first/definition/response.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(operation:, status:, response_object:, content_type:, content_schema:) ⇒ Response

Returns a new instance of Response.



6
7
8
9
10
11
12
# File 'lib/openapi_first/definition/response.rb', line 6

def initialize(operation:, status:, response_object:, content_type:, content_schema:)
  @operation = operation
  @response_object = response_object
  @status = status
  @content_type = content_type
  @content_schema = content_schema
end

Instance Attribute Details

#content_schemaObject (readonly)

Returns the value of attribute content_schema.



14
15
16
# File 'lib/openapi_first/definition/response.rb', line 14

def content_schema
  @content_schema
end

#content_typeObject (readonly)

Returns the value of attribute content_type.



14
15
16
# File 'lib/openapi_first/definition/response.rb', line 14

def content_type
  @content_type
end

#operationObject (readonly)

Returns the value of attribute operation.



14
15
16
# File 'lib/openapi_first/definition/response.rb', line 14

def operation
  @operation
end

#statusObject (readonly)

Returns the value of attribute status.



14
15
16
# File 'lib/openapi_first/definition/response.rb', line 14

def status
  @status
end

Instance Method Details

#descriptionObject



20
21
22
# File 'lib/openapi_first/definition/response.rb', line 20

def description
  @response_object['description']
end

#headersObject



16
17
18
# File 'lib/openapi_first/definition/response.rb', line 16

def headers
  @response_object['headers']
end