class Snuffle::Formatters::Text

Public Instance Methods

export() click to toggle source
# File lib/snuffle/formatters/text.rb, line 14
def export
  table = ::Text::Table.new
  table.head = header
  table.rows = rows
  table.to_s
end
header() click to toggle source
# File lib/snuffle/formatters/text.rb, line 10
def header
  columns.map(&:titleize)
end
rows() click to toggle source
# 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