Class: HowIs::JsonReport

Inherits:
BaseReport show all
Defined in:
lib/how_is/report/json.rb

Overview

A JSON report.

Instance Attribute Summary

Attributes inherited from BaseReport

#analysis

Instance Method Summary collapse

Methods inherited from BaseReport

#generate_report_text!, #header, #horizontal_bar_graph, #link, #text, #title, #to_h, #to_json, #unordered_list

Instance Method Details

#exportObject

Generates a report.



22
23
24
# File 'lib/how_is/report/json.rb', line 22

def export
  to_json
end

#export_file(file) ⇒ Object

Generates a report and writes it to a file.



28
29
30
31
32
# File 'lib/how_is/report/json.rb', line 28

def export_file(file)
  File.open(file, "w") do |f|
    f.write export
  end
end

#formatSymbol

The format of the report.

Returns:

  • (Symbol)

    The name of the format.



16
17
18
# File 'lib/how_is/report/json.rb', line 16

def format
  :json
end