Class: Hashira::Report::FindingLines
- Inherits:
-
Object
- Object
- Hashira::Report::FindingLines
- Defined in:
- lib/hashira/report/finding_lines.rb
Constant Summary collapse
- SAMPLE =
4
Instance Method Summary collapse
- #emit ⇒ Object
-
#initialize(finding, indent: "", io: $stdout) ⇒ FindingLines
constructor
A new instance of FindingLines.
- #print ⇒ Object
Constructor Details
#initialize(finding, indent: "", io: $stdout) ⇒ FindingLines
Returns a new instance of FindingLines.
6 7 8 9 10 |
# File 'lib/hashira/report/finding_lines.rb', line 6 def initialize(finding, indent: "", io: $stdout) @finding = finding @indent = indent @io = io end |
Instance Method Details
#emit ⇒ Object
17 18 19 20 21 |
# File 'lib/hashira/report/finding_lines.rb', line 17 def emit print overflow = @finding.evidence.size - SAMPLE @io.puts("#{@indent} · … (#{overflow} more)") if overflow.positive? end |
#print ⇒ Object
12 13 14 15 |
# File 'lib/hashira/report/finding_lines.rb', line 12 def print @io.puts("#{@indent}#{@finding.kind}: #{@finding.}") @finding.evidence.first(SAMPLE).each { @io.puts("#{@indent} · #{it}") } end |