Class: Swagger::V2::Response

Inherits:
SwaggerObject show all
Defined in:
lib/swagger/v2/response.rb

Overview

Class representing a Swagger “Response Object”.

See Also:

Instance Attribute Summary

Attributes inherited from SwaggerObject

#parent

Instance Method Summary collapse

Methods inherited from SwaggerObject

field, #initialize, required_field

Methods included from Attachable

#attach_parent, #attach_to_children, #root

Constructor Details

This class inherits a constructor from Swagger::SwaggerObject

Instance Method Details

#status_codeObject


15
16
17
18
19
20
21
22
23
# File 'lib/swagger/v2/response.rb', line 15

def status_code
  # FIXME: swagger-spec needs a defined way to define codes
  code = parent.responses.key self
  code = '200' if code == 'default'
  code.to_i
rescue
  # TODO: Warning?
  200
end