Class: Evilution::Reporter::CLI::SectionRenderer Private

Inherits:
Object
  • Object
show all
Defined in:
lib/evilution/reporter/cli/section_renderer.rb

This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.

Instance Method Summary collapse

Instance Method Details

#call(section, summary) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



6
7
8
9
10
11
12
13
14
# File 'lib/evilution/reporter/cli/section_renderer.rb', line 6

def call(section, summary)
  items = section.fetcher.call(summary)
  return [] if items.empty?

  title = section.title.respond_to?(:call) ? section.title.call(items) : section.title
  lines = ["", title]
  items.each { |item| lines << section.formatter.format(item) }
  lines
end