Class: OasCore::Spec::Operation

Inherits:
Object
  • Object
show all
Includes:
Specable
Defined in:
lib/oas_core/spec/operation.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Specable

#as_json, #to_spec

Constructor Details

#initialize(specification) ⇒ Operation

Returns a new instance of Operation.



11
12
13
14
15
16
17
18
19
20
21
# File 'lib/oas_core/spec/operation.rb', line 11

def initialize(specification)
  @specification = specification
  @summary = ''
  @operation_id = ''
  @tags = []
  @description = @summary
  @parameters = []
  @request_body = {}
  @responses =  Spec::Responses.new(specification)
  @security = []
end

Instance Attribute Details

#descriptionObject

Returns the value of attribute description.



8
9
10
# File 'lib/oas_core/spec/operation.rb', line 8

def description
  @description
end

#operation_idObject

Returns the value of attribute operation_id.



8
9
10
# File 'lib/oas_core/spec/operation.rb', line 8

def operation_id
  @operation_id
end

#parametersObject

Returns the value of attribute parameters.



8
9
10
# File 'lib/oas_core/spec/operation.rb', line 8

def parameters
  @parameters
end

#request_bodyObject

Returns the value of attribute request_body.



8
9
10
# File 'lib/oas_core/spec/operation.rb', line 8

def request_body
  @request_body
end

#responsesObject

Returns the value of attribute responses.



8
9
10
# File 'lib/oas_core/spec/operation.rb', line 8

def responses
  @responses
end

#securityObject

Returns the value of attribute security.



8
9
10
# File 'lib/oas_core/spec/operation.rb', line 8

def security
  @security
end

#specificationObject

Returns the value of attribute specification.



8
9
10
# File 'lib/oas_core/spec/operation.rb', line 8

def specification
  @specification
end

#summaryObject

Returns the value of attribute summary.



8
9
10
# File 'lib/oas_core/spec/operation.rb', line 8

def summary
  @summary
end

#tagsObject

Returns the value of attribute tags.



8
9
10
# File 'lib/oas_core/spec/operation.rb', line 8

def tags
  @tags
end

Instance Method Details

#oas_fieldsObject



23
24
25
# File 'lib/oas_core/spec/operation.rb', line 23

def oas_fields
  %i[tags summary description operation_id parameters request_body responses security]
end