Class: ResumeArrayFormatter
Overview
ArrayFormatter class: format report data into an array
Instance Method Summary
collapse
#deinit, #init, #trim, #w
Constructor Details
Returns a new instance of ResumeArrayFormatter.
7
8
9
10
|
# File 'lib/teuton/report/formatter/resume_array_formatter.rb', line 7
def initialize(report)
super(report)
@data = {}
end
|
Instance Method Details
#build_cases_data ⇒ Object
31
32
33
|
# File 'lib/teuton/report/formatter/resume_array_formatter.rb', line 31
def build_cases_data
@data[:cases] = @lines
end
|
#build_data ⇒ Object
18
19
20
21
22
23
|
# File 'lib/teuton/report/formatter/resume_array_formatter.rb', line 18
def build_data
build_initial_data
build_cases_data
build_final_data
build_hof_data
end
|
#build_final_data ⇒ Object
35
36
37
38
39
|
# File 'lib/teuton/report/formatter/resume_array_formatter.rb', line 35
def build_final_data
tail = {}
@tail.each { |key, value| tail[key] = value }
@data[:results] = tail
end
|
#build_hof_data ⇒ Object
41
42
43
44
45
46
47
48
|
# File 'lib/teuton/report/formatter/resume_array_formatter.rb', line 41
def build_hof_data
app = Application.instance
fame = {}
if app.options[:case_number] > 2
app.hall_of_fame.each { |line| fame[line[0]] = line[1] }
end
@data[:hall_of_fame] = fame
end
|
#build_initial_data ⇒ Object
25
26
27
28
29
|
# File 'lib/teuton/report/formatter/resume_array_formatter.rb', line 25
def build_initial_data
head = {}
@head.each { |key, value| head[key] = value }
@data[:config] = head
end
|
#process ⇒ Object
12
13
14
15
16
|
# File 'lib/teuton/report/formatter/resume_array_formatter.rb', line 12
def process
build_data
w @data.to_s deinit
end
|