Class: OasRails::Spec::Operation

Inherits:
Object
  • Object
show all
Includes:
Specable
Defined in:
lib/oas_rails/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.



8
9
10
11
12
13
14
15
16
17
18
# File 'lib/oas_rails/spec/operation.rb', line 8

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.



6
7
8
# File 'lib/oas_rails/spec/operation.rb', line 6

def description
  @description
end

#operation_idObject

Returns the value of attribute operation_id.



6
7
8
# File 'lib/oas_rails/spec/operation.rb', line 6

def operation_id
  @operation_id
end

#parametersObject

Returns the value of attribute parameters.



6
7
8
# File 'lib/oas_rails/spec/operation.rb', line 6

def parameters
  @parameters
end

#request_bodyObject

Returns the value of attribute request_body.



6
7
8
# File 'lib/oas_rails/spec/operation.rb', line 6

def request_body
  @request_body
end

#responsesObject

Returns the value of attribute responses.



6
7
8
# File 'lib/oas_rails/spec/operation.rb', line 6

def responses
  @responses
end

#securityObject

Returns the value of attribute security.



6
7
8
# File 'lib/oas_rails/spec/operation.rb', line 6

def security
  @security
end

#specificationObject

Returns the value of attribute specification.



6
7
8
# File 'lib/oas_rails/spec/operation.rb', line 6

def specification
  @specification
end

#summaryObject

Returns the value of attribute summary.



6
7
8
# File 'lib/oas_rails/spec/operation.rb', line 6

def summary
  @summary
end

#tagsObject

Returns the value of attribute tags.



6
7
8
# File 'lib/oas_rails/spec/operation.rb', line 6

def tags
  @tags
end

Instance Method Details

#oas_fieldsObject



20
21
22
# File 'lib/oas_rails/spec/operation.rb', line 20

def oas_fields
  [:tags, :summary, :description, :operation_id, :parameters, :request_body, :responses, :security]
end