Class: RailsAutodoc::OperationAnnotation

Inherits:
Object
  • Object
show all
Defined in:
lib/rails_autodoc/registry.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(controller:, action:) ⇒ OperationAnnotation

Returns a new instance of OperationAnnotation.



18
19
20
21
22
23
24
25
26
27
28
29
30
31
# File 'lib/rails_autodoc/registry.rb', line 18

def initialize(controller:, action:)
  @controller = controller
  @action = action
  @summary = nil
  @description = nil
  @tags = []
  @deprecated = false
  @body_params = []
  @query_params = []
  @responses = {}
  @security = nil
  @request_body_schema = nil
  @exclude = false
end

Instance Attribute Details

#actionObject

Returns the value of attribute action.



5
6
7
# File 'lib/rails_autodoc/registry.rb', line 5

def action
  @action
end

#body_paramsObject

Returns the value of attribute body_params.



5
6
7
# File 'lib/rails_autodoc/registry.rb', line 5

def body_params
  @body_params
end

#controllerObject

Returns the value of attribute controller.



5
6
7
# File 'lib/rails_autodoc/registry.rb', line 5

def controller
  @controller
end

#deprecatedObject

Returns the value of attribute deprecated.



5
6
7
# File 'lib/rails_autodoc/registry.rb', line 5

def deprecated
  @deprecated
end

#descriptionObject

Returns the value of attribute description.



5
6
7
# File 'lib/rails_autodoc/registry.rb', line 5

def description
  @description
end

#excludeObject

Returns the value of attribute exclude.



5
6
7
# File 'lib/rails_autodoc/registry.rb', line 5

def exclude
  @exclude
end

#query_paramsObject

Returns the value of attribute query_params.



5
6
7
# File 'lib/rails_autodoc/registry.rb', line 5

def query_params
  @query_params
end

#request_body_schemaObject

Returns the value of attribute request_body_schema.



5
6
7
# File 'lib/rails_autodoc/registry.rb', line 5

def request_body_schema
  @request_body_schema
end

#responsesObject

Returns the value of attribute responses.



5
6
7
# File 'lib/rails_autodoc/registry.rb', line 5

def responses
  @responses
end

#securityObject

Returns the value of attribute security.



5
6
7
# File 'lib/rails_autodoc/registry.rb', line 5

def security
  @security
end

#summaryObject

Returns the value of attribute summary.



5
6
7
# File 'lib/rails_autodoc/registry.rb', line 5

def summary
  @summary
end

#tagsObject

Returns the value of attribute tags.



5
6
7
# File 'lib/rails_autodoc/registry.rb', line 5

def tags
  @tags
end

Instance Method Details

#operation_idObject



33
34
35
# File 'lib/rails_autodoc/registry.rb', line 33

def operation_id
  "#{controller.name.underscore.tr('/', '_')}_#{action}"
end