Class: OpenapiFirst::Response
- Inherits:
-
Object
- Object
- OpenapiFirst::Response
- Includes:
- HasContent
- Defined in:
- lib/openapi_first/definition/response.rb
Instance Attribute Summary collapse
-
#status ⇒ Object
readonly
Returns the value of attribute status.
Instance Method Summary collapse
- #content? ⇒ Boolean
- #description ⇒ Object
- #headers ⇒ Object
-
#initialize(status, response_object, operation) ⇒ Response
constructor
A new instance of Response.
Methods included from HasContent
Constructor Details
#initialize(status, response_object, operation) ⇒ Response
Returns a new instance of Response.
9 10 11 12 13 |
# File 'lib/openapi_first/definition/response.rb', line 9 def initialize(status, response_object, operation) @status = status&.to_i @object = response_object @operation = operation end |
Instance Attribute Details
#status ⇒ Object (readonly)
Returns the value of attribute status.
15 16 17 |
# File 'lib/openapi_first/definition/response.rb', line 15 def status @status end |
Instance Method Details
#content? ⇒ Boolean
25 26 27 |
# File 'lib/openapi_first/definition/response.rb', line 25 def content? !!content&.any? end |
#description ⇒ Object
17 18 19 |
# File 'lib/openapi_first/definition/response.rb', line 17 def description @object['description'] end |
#headers ⇒ Object
21 22 23 |
# File 'lib/openapi_first/definition/response.rb', line 21 def headers @object['headers'] end |