Class: SwaggerDocsGenerator::MetadataJsons

Inherits:
Object
  • Object
show all
Defined in:
lib/swagger_docs_generator/metadata/jsons.rb

Overview

Parse temporary json files

Instance Method Summary collapse

Constructor Details

#initializeMetadataJsons

Returns a new instance of MetadataJsons.



8
9
10
11
# File 'lib/swagger_docs_generator/metadata/jsons.rb', line 8

def initialize
  @paths = { paths: {} }
  @tags_array = []
end

Instance Method Details

#construct_swagger_fileObject



13
14
15
16
17
18
19
20
# File 'lib/swagger_docs_generator/metadata/jsons.rb', line 13

def construct_swagger_file
  hash = {}
  files_tmp.each do |file|
    @paths[:paths].merge!(read_part_json(file, 'paths'))
    @tags_array.push read_part_json(file, 'tags')
  end
  hash.merge(sort_paths).merge(tags: @tags_array)
end