Sha256: bc7fa5e1e46291734d8b964ef57bf2bbedf346738fd3412551bcbdb320bd8ec8
Contents?: true
Size: 1.08 KB
Versions: 17
Compression:
Stored size: 1.08 KB
Contents
module Reek module Report module HeadingFormatter # # Base class for heading formatters. # Is responsible for formatting the heading emitted for each examiner # # @abstract Override {#show_header?} to implement a heading formatter. class Base attr_reader :report_formatter def initialize(report_formatter) @report_formatter = report_formatter end # :reek:UtilityFunction def show_header?(_examiner) raise NotImplementedError end def header(examiner) if show_header?(examiner) report_formatter.header examiner else '' end end end # # Lists out each examiner, even if it has no smell # class Verbose < Base def show_header?(_examiner) true end end # # Lists only smelly examiners # class Quiet < Base # :reek:UtilityFunction def show_header?(examiner) examiner.smelly? end end end end end
Version data entries
17 entries across 17 versions & 1 rubygems