Class: Swagger::V2::Operation
- Inherits:
-
SwaggerObject
- Object
- Hashie::Dash
- SwaggerObject
- Swagger::V2::Operation
- Extended by:
- Forwardable
- Defined in:
- lib/swagger/v2/operation.rb
Overview
Class representing a Swagger “Operation Object”.
Instance Attribute Summary
Attributes inherited from SwaggerObject
Instance Method Summary collapse
-
#api_title ⇒ Object
TODO: Add externalDocs.
- #default_response ⇒ Object
- #full_name ⇒ Object
- #signature ⇒ Object
- #verb ⇒ Object
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
#api_title ⇒ Object
TODO: Add externalDocs
27 28 29 |
# File 'lib/swagger/v2/operation.rb', line 27 def api_title root.info.title end |
#default_response ⇒ Object
43 44 45 46 47 48 49 |
# File 'lib/swagger/v2/operation.rb', line 43 def default_response return nil if responses.values.nil? # FIXME: Swagger isn't very clear on "normal response codes" # In the examples, default is actually an error responses['200'] || responses['201'] || responses['default'] || responses.values.first end |
#full_name ⇒ Object
31 32 33 |
# File 'lib/swagger/v2/operation.rb', line 31 def full_name "#{api_title} - #{summary}" end |
#signature ⇒ Object
39 40 41 |
# File 'lib/swagger/v2/operation.rb', line 39 def signature "#{verb.to_s.upcase} #{parent.uri_template}" end |
#verb ⇒ Object
35 36 37 |
# File 'lib/swagger/v2/operation.rb', line 35 def verb parent.operations.key self end |