Class: Reek::Report::SimpleWarningFormatter Private

Inherits:
Object
  • Object
show all
Defined in:
lib/reek/report/formatter.rb

Overview

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.

Basic formatter that just shows a simple message for each warning, prepended with the result of the passed-in location formatter.

Direct Known Subclasses

WikiLinkWarningFormatter

Instance Method Summary collapse

Constructor Details

#initialize(location_formatter = BlankLocationFormatter) ⇒ SimpleWarningFormatter

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.

Returns a new instance of SimpleWarningFormatter.



33
34
35
# File 'lib/reek/report/formatter.rb', line 33

def initialize(location_formatter = BlankLocationFormatter)
  @location_formatter = location_formatter
end

Instance Method Details

#format(warning) ⇒ 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.



37
38
39
# File 'lib/reek/report/formatter.rb', line 37

def format(warning)
  "#{@location_formatter.format(warning)}#{base_format(warning)}"
end