Class: Reek::Report::WikiLinkWarningFormatter Private
- Inherits:
-
SimpleWarningFormatter
- Object
- SimpleWarningFormatter
- Reek::Report::WikiLinkWarningFormatter
- 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.
Formatter that adds a link to the wiki to the basic message from SimpleWarningFormatter.
Constant Summary collapse
- BASE_URL_FOR_HELP_LINK =
This constant is part of a private API. You should avoid using this constant if possible, as it may be removed or be changed in the future.
'https://github.com/troessner/reek/wiki/'
Instance Method Summary collapse
- #class_name_to_param(name) ⇒ Object private
- #explanatory_link(warning) ⇒ Object private
- #format(warning) ⇒ Object private
Methods inherited from SimpleWarningFormatter
Constructor Details
This class inherits a constructor from Reek::Report::SimpleWarningFormatter
Instance Method Details
#class_name_to_param(name) ⇒ 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.
65 66 67 |
# File 'lib/reek/report/formatter.rb', line 65 def class_name_to_param(name) name.split(/(?=[A-Z])/).join('-') end |
#explanatory_link(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.
61 62 63 |
# File 'lib/reek/report/formatter.rb', line 61 def explanatory_link(warning) "#{BASE_URL_FOR_HELP_LINK}#{class_name_to_param(warning.smell_type)}" end |
#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.
56 57 58 59 |
# File 'lib/reek/report/formatter.rb', line 56 def format(warning) "#{super} " \ "[#{explanatory_link(warning)}]" end |