Class: Dox::Printers::DocumentPrinter

Inherits:
BasePrinter show all
Defined in:
lib/dox/printers/document_printer.rb

Instance Attribute Summary

Attributes inherited from BasePrinter

#spec

Instance Method Summary collapse

Methods inherited from BasePrinter

#find_or_add, #format_desc, #formatted_body, #pretty_xml, #read_file

Constructor Details

#initialize(output) ⇒ DocumentPrinter

Returns a new instance of DocumentPrinter.



4
5
6
7
# File 'lib/dox/printers/document_printer.rb', line 4

def initialize(output)
  super(body)
  @output = output
end

Instance Method Details



9
10
11
12
13
14
15
16
17
18
19
20
21
# File 'lib/dox/printers/document_printer.rb', line 9

def print(passed_examples)
  spec['paths'] = {}
  spec['tags'] = []
  spec['x-tagGroups'] = []

  passed_examples.sort.each do |_, resource_group|
    group_printer.print(resource_group)
  end

  order_groups

  @output.puts(JSON.pretty_generate(spec))
end