Class: ResumeHTMLFormatter

Inherits:
ResumeYAMLFormatter show all
Defined in:
lib/teuton/report/formatter/resume_html_formatter.rb

Overview

HTMLFormatter class receive a [Report] and generates HAML output.

Instance Method Summary collapse

Methods inherited from ResumeArrayFormatter

#build_cases_data, #build_data, #build_final_data, #build_hof_data, #build_initial_data

Methods inherited from BaseFormatter

#deinit, #init, #trim, #w

Constructor Details

#initialize(report) ⇒ ResumeHTMLFormatter

Class constructor

Parameters:

  • report (Report)

    Parent object that contains data to be exported.



13
14
15
16
17
18
# File 'lib/teuton/report/formatter/resume_html_formatter.rb', line 13

def initialize(report)
  super(report)
  @data = {}
  filepath = File.join(File.dirname(__FILE__), '..', '..', 'files', 'template', 'resume.html')
  @template = File.read(filepath)
end

Instance Method Details

#build_pageObject

Build html case page



30
31
32
33
34
35
36
37
38
# File 'lib/teuton/report/formatter/resume_html_formatter.rb', line 30

def build_page
  config = @data[:config]
  cases = @data[:cases]
  results = @data[:results]
  hall_of_fame = @data[:hall_of_fame]
  version = Application::VERSION
  renderer = ERB.new(@template)
  w renderer.result(binding)
end

#processObject

Process data from parent object and export it into YAML format.



22
23
24
25
26
# File 'lib/teuton/report/formatter/resume_html_formatter.rb', line 22

def process
  build_data
  build_page
  deinit
end