Class: SwaggerDocsGenerator::MetadataPath
- Inherits:
-
MetadataController
- Object
- Metadata
- MetadataController
- SwaggerDocsGenerator::MetadataPath
- Defined in:
- lib/swagger_docs_generator/metadata/path.rb
Overview
# Metadata generated
Generate metadata for block paths in swagger specification
Instance Method Summary collapse
-
#construct_swagger_file ⇒ Object
Each controller parsed.
-
#initialize ⇒ MetadataPath
constructor
A new instance of MetadataPath.
Constructor Details
#initialize ⇒ MetadataPath
Returns a new instance of MetadataPath.
10 11 12 |
# File 'lib/swagger_docs_generator/metadata/path.rb', line 10 def initialize super end |
Instance Method Details
#construct_swagger_file ⇒ Object
Each controller parsed
15 16 17 18 19 20 21 22 |
# File 'lib/swagger_docs_generator/metadata/path.rb', line 15 def construct_swagger_file hash = {} controllers.each do |controller| file = File.join(path, "#{controller.controller_name}.json") hash.merge!(JSON.parse(File.read(file))['paths']) if File.exist?(file) end { paths: hash } end |