Class: SwaggerParser::Operation
- Inherits:
-
SourceBasedObject
- Object
- SourceBasedObject
- SwaggerParser::Operation
- Includes:
- Extendable, ExternalDocsAttributable
- Defined in:
- lib/swagger_parser/operation.rb
Instance Attribute Summary collapse
-
#http_method ⇒ Object
readonly
Returns the value of attribute http_method.
Attributes inherited from SourceBasedObject
Instance Method Summary collapse
- #consumes ⇒ Object
- #deprecated ⇒ false, true
- #description ⇒ Object
-
#initialize(source, http_method:) ⇒ Operation
constructor
A new instance of Operation.
- #operation_id ⇒ Object
- #parameters ⇒ SwaggerParser::Parameters
- #produces ⇒ Object
- #responses ⇒ SwaggerParser::Responses
- #schemes ⇒ Object
- #security ⇒ Object
- #summary ⇒ Object
- #tags ⇒ Array<String>
Methods included from ExternalDocsAttributable
Methods included from Extendable
Constructor Details
#initialize(source, http_method:) ⇒ Operation
Returns a new instance of Operation.
16 17 18 19 |
# File 'lib/swagger_parser/operation.rb', line 16 def initialize(source, http_method:) super(source) @http_method = http_method end |
Instance Attribute Details
#http_method ⇒ Object (readonly)
Returns the value of attribute http_method.
12 13 14 |
# File 'lib/swagger_parser/operation.rb', line 12 def http_method @http_method end |
Instance Method Details
#consumes ⇒ Object
22 23 24 |
# File 'lib/swagger_parser/operation.rb', line 22 def consumes source["consumes"] || [] end |
#deprecated ⇒ false, true
27 28 29 |
# File 'lib/swagger_parser/operation.rb', line 27 def deprecated !!source["deprecated"] end |
#description ⇒ Object
32 33 34 |
# File 'lib/swagger_parser/operation.rb', line 32 def description source["description"] end |
#operation_id ⇒ Object
37 38 39 |
# File 'lib/swagger_parser/operation.rb', line 37 def operation_id source["operationId"] end |
#parameters ⇒ SwaggerParser::Parameters
42 43 44 |
# File 'lib/swagger_parser/operation.rb', line 42 def parameters SwaggerParser::Parameters.new(source["parameters"] || {}) end |
#produces ⇒ Object
47 48 49 |
# File 'lib/swagger_parser/operation.rb', line 47 def produces source["produces"] end |
#responses ⇒ SwaggerParser::Responses
52 53 54 |
# File 'lib/swagger_parser/operation.rb', line 52 def responses SwaggerParser::Responses.new(source["responses"] || {}) end |
#schemes ⇒ Object
57 58 59 |
# File 'lib/swagger_parser/operation.rb', line 57 def schemes source["schemes"] end |
#security ⇒ Object
62 63 64 |
# File 'lib/swagger_parser/operation.rb', line 62 def security SwaggerParser::Security.new(source["security"] || {}) end |
#summary ⇒ Object
67 68 69 |
# File 'lib/swagger_parser/operation.rb', line 67 def summary source["summary"] end |
#tags ⇒ Array<String>
72 73 74 |
# File 'lib/swagger_parser/operation.rb', line 72 def source["tags"] || [] end |