Class: Snuffle::Formatters::Text
- Inherits:
-
Object
- Object
- Snuffle::Formatters::Text
show all
- Includes:
- Base
- Defined in:
- lib/snuffle/formatters/text.rb
Instance Method Summary
collapse
Methods included from Base
#columns, #content, #file_extension, #filename, included, #initialize, #output_path, #path_to_results, #root_path
Instance Method Details
#export ⇒ Object
14
15
16
17
18
19
|
# File 'lib/snuffle/formatters/text.rb', line 14
def export
table = ::Text::Table.new
table.head =
table.rows = rows
table.to_s
end
|
10
11
12
|
# File 'lib/snuffle/formatters/text.rb', line 10
def
columns.map(&:titleize)
end
|
#rows ⇒ Object
21
22
23
24
25
|
# File 'lib/snuffle/formatters/text.rb', line 21
def rows
summary.cohorts.group_by{|c| c.values}.map do |cohort|
[summary.path_to_file, summary.class_name, "#{cohort[0].join(', ')}", cohort[1].map(&:line_numbers).join(", ")]
end
end
|