Module: SwaggerDocsGenerator::Methods

Defined in:
lib/swagger_docs_generator/methods.rb

Overview

# Methods for controller

Methods adding to controller parsing in rails appliation

Instance Method Summary collapse

Instance Method Details

#swagger_controller(description) ⇒ Object Also known as: scontroller

Create json file for controller. Create all temporary file for each controller.



11
12
13
14
# File 'lib/swagger_docs_generator/methods.rb', line 11

def swagger_controller(description)
  parse = ParserController.new(description)
  parse.adding_tag
end

#swagger_definition(name, &block) ⇒ Object Also known as: sdefinition

Complete definitions objects for each controller.



24
25
26
27
# File 'lib/swagger_docs_generator/methods.rb', line 24

def swagger_definition(name, &block)
  parse = ParserDefinition.new(name, &block)
  parse.adding_definition
end

#swagger_doc(action, &block) ⇒ Object Also known as: sdoc

Complete json file with datas to method and controller. Each action to controller is writing in temporary file.



18
19
20
21
# File 'lib/swagger_docs_generator/methods.rb', line 18

def swagger_doc(action, &block)
  parse = ParserAction.new(action, &block)
  parse.adding_path
end