Class: Society::Formatter::Report::HTML

Inherits:
Object
  • Object
show all
Defined in:
lib/society/formatter/report/html.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(json_data:, output_path: default_output_path) ⇒ HTML

Returns a new instance of HTML.



8
9
10
11
# File 'lib/society/formatter/report/html.rb', line 8

def initialize(json_data:, output_path: default_output_path)
  @json_data = json_data
  @output_path = output_path
end

Instance Attribute Details

#json_dataObject (readonly)

Returns the value of attribute json_data.



6
7
8
# File 'lib/society/formatter/report/html.rb', line 6

def json_data
  @json_data
end

#output_pathObject (readonly)

Returns the value of attribute output_path.



6
7
8
# File 'lib/society/formatter/report/html.rb', line 6

def output_path
  @output_path
end

Instance Method Details

#writeObject



13
14
15
16
17
18
19
20
# File 'lib/society/formatter/report/html.rb', line 13

def write
  prepare_output_directory
  write_html
  write_csv
  copy_assets
  write_json_data
  puts "Results written to #{self.output_path}." unless self.output_path.nil?
end