class Reek::Report::HeadingFormatterBase
Base class for heading formatters. Is responsible for formatting the heading emitted for each examiner
@abstract Override {#show_header?} to implement a heading formatter.
Public Instance Methods
Source
# File lib/reek/report/heading_formatter.rb, line 16 def header(examiner) if show_header?(examiner) formatted_header examiner else '' end end
Source
# File lib/reek/report/heading_formatter.rb, line 12 def show_header?(_examiner) raise NotImplementedError end
@quality :reek:UtilityFunction
Private Instance Methods
Source
# File lib/reek/report/heading_formatter.rb, line 26 def formatted_header(examiner) count = examiner.smells_count result = Rainbow("#{examiner.origin} -- ").cyan + Rainbow("#{count} warning").yellow result += Rainbow('s').yellow unless count == 1 result end