Class: DocParser::MultiOutput

Inherits:
Output
  • Object
show all
Defined in:
lib/docparser/output/multi_output.rb

Overview

The MultiOutput output combines multiple outputs. It creates a CSV, HTML, YAML and XLSX Output file

Constant Summary collapse

OUTPUT_TYPES =

All the possible outputs

{ csv: CSVOutput, html: HTMLOutput, yml: YAMLOutput,
xlsx: XLSXOutput, json: JSONOutput }

Instance Attribute Summary

Attributes inherited from Output

#filename

Instance Method Summary collapse

Methods inherited from Output

#footer, #header, #open_file, #write_row

Instance Method Details

#add_row(row) ⇒ Object


28
29
30
# File 'lib/docparser/output/multi_output.rb', line 28

def add_row(row)
  @outputs.each { |out|  out.add_row row }
end

#closeObject


36
37
38
# File 'lib/docparser/output/multi_output.rb', line 36

def close
  @outputs.each(&:close)
end

#header=(row) ⇒ Object


24
25
26
# File 'lib/docparser/output/multi_output.rb', line 24

def header=(row)
  @outputs.each { |out|  out.header = row }
end

#rowcountObject


32
33
34
# File 'lib/docparser/output/multi_output.rb', line 32

def rowcount
  @outputs.map(&:rowcount).min
end