Class: SwaggerDocsGenerator::ParserReadme
- Defined in:
- lib/swagger_docs_generator/parser/readme.rb
Overview
# Parse Readme information
Parse block code for display basic information for this API Doc
Instance Attribute Summary
Attributes inherited from Parser
Instance Method Summary collapse
- #adding_readme ⇒ Object
-
#initialize(readme_file) ⇒ ParserReadme
constructor
A new instance of ParserReadme.
Methods inherited from Parser
Constructor Details
#initialize(readme_file) ⇒ ParserReadme
Returns a new instance of ParserReadme.
8 9 10 11 12 |
# File 'lib/swagger_docs_generator/parser/readme.rb', line 8 def initialize(readme_file) @tag_name = 'README' @readme = readme_file create_file end |
Instance Method Details
#adding_readme ⇒ Object
14 15 16 17 18 19 20 21 |
# File 'lib/swagger_docs_generator/parser/readme.rb', line 14 def adding_readme json = JSON.parse(File.read(temporary_file)) File.open(temporary_file, 'w') do |file| json['paths'].merge!(complete_path) json['tags'].merge!(complete_tag) file.puts(JSON.pretty_generate(json)) end end |