Class: Dox::Printers::DocumentPrinter
- Inherits:
-
BasePrinter
- Object
- BasePrinter
- Dox::Printers::DocumentPrinter
- Defined in:
- lib/dox/printers/document_printer.rb
Instance Attribute Summary
Attributes inherited from BasePrinter
Instance Method Summary collapse
-
#initialize(output) ⇒ DocumentPrinter
constructor
A new instance of DocumentPrinter.
- #print(passed_examples) ⇒ Object
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
#print(passed_examples) ⇒ Object
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 |