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.



6
7
8
9
# File 'lib/swagger_docs_generator/metadata/jsons.rb', line 6

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

Instance Method Details

#construct_swagger_fileObject



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

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(@paths).merge(tags: @tags_array)
end