Class: SwaggerParser::Operation

Inherits:
SourceBasedObject show all
Includes:
Extendable, ExternalDocsAttributable
Defined in:
lib/swagger_parser/operation.rb

Instance Attribute Summary collapse

Attributes inherited from SourceBasedObject

#source

Instance Method Summary collapse

Methods included from ExternalDocsAttributable

#external_docs

Methods included from Extendable

#extensions

Constructor Details

#initialize(source, http_method:) ⇒ Operation

Returns a new instance of Operation.

Parameters:

  • http_method (String)
  • source (Object)


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_methodObject (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

#consumesObject

Returns:

  • (Object)


22
23
24
# File 'lib/swagger_parser/operation.rb', line 22

def consumes
  source["consumes"] || []
end

#deprecatedfalse, true

Returns:

  • (false, true)


27
28
29
# File 'lib/swagger_parser/operation.rb', line 27

def deprecated
  !!source["deprecated"]
end

#descriptionObject

Returns:

  • (Object)


32
33
34
# File 'lib/swagger_parser/operation.rb', line 32

def description
  source["description"]
end

#operation_idObject

Returns:

  • (Object)


37
38
39
# File 'lib/swagger_parser/operation.rb', line 37

def operation_id
  source["operationId"]
end

#parametersSwaggerParser::Parameters



42
43
44
# File 'lib/swagger_parser/operation.rb', line 42

def parameters
  SwaggerParser::Parameters.new(source["parameters"] || {})
end

#producesObject

Returns:

  • (Object)


47
48
49
# File 'lib/swagger_parser/operation.rb', line 47

def produces
  source["produces"]
end

#responsesSwaggerParser::Responses



52
53
54
# File 'lib/swagger_parser/operation.rb', line 52

def responses
  SwaggerParser::Responses.new(source["responses"] || {})
end

#schemesObject

Returns:

  • (Object)


57
58
59
# File 'lib/swagger_parser/operation.rb', line 57

def schemes
  source["schemes"]
end

#securityObject

Returns:

  • (Object)


62
63
64
# File 'lib/swagger_parser/operation.rb', line 62

def security
  SwaggerParser::Security.new(source["security"] || {})
end

#summaryObject

Returns:

  • (Object)


67
68
69
# File 'lib/swagger_parser/operation.rb', line 67

def summary
  source["summary"]
end

#tagsArray<String>

Returns:

  • (Array<String>)


72
73
74
# File 'lib/swagger_parser/operation.rb', line 72

def tags
  source["tags"] || []
end