class Ameba::Formatter::ExplainFormatter
- Ameba::Formatter::ExplainFormatter
- Reference
- Object
Overview
A formatter that shows the detailed explanation of the issue at a specific location.
Included Modules
Defined in:
ameba/formatter/explain_formatter.crConstant Summary
-
HEADING =
"## "
-
LINE_BREAK =
"\n"
-
PREFIX =
" "
Constructors
-
.new(output, loc)
Creates a new instance of ExplainFormatter.
Instance Method Summary
-
#finished(sources)
Reports the explainations at the @location.
- #location : Crystal::Location
- #output : IO::FileDescriptor | IO::Memory
Instance methods inherited from module Ameba::Formatter::Util
affected_code(source, location, max_length = 100, placeholder = " ...", prompt = "> ")
affected_code
Constructor Detail
def self.new(output, loc)
#
Creates a new instance of ExplainFormatter. Accepts output which indicates the io where the explanation will be wrtitten to. Second argument is location which indicates the location to explain.
ExplainFormatter.new output,
{file: path, line: line_number, column: column_number}