Class: Chutney::Formatter

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

Overview

base class for all formatters

Direct Known Subclasses

JSONFormatter, PieFormatter, RainbowFormatter

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeFormatter

Returns a new instance of Formatter.



8
9
10
# File 'lib/chutney/formatter.rb', line 8

def initialize
  @results = {}
end

Instance Attribute Details

#resultsObject

Returns the value of attribute results.



6
7
8
# File 'lib/chutney/formatter.rb', line 6

def results
  @results
end

Instance Method Details

#filesObject



12
13
14
# File 'lib/chutney/formatter.rb', line 12

def files
  results.map { |k, _v| k }
end

#files_with_issuesObject



16
17
18
# File 'lib/chutney/formatter.rb', line 16

def files_with_issues
  results.filter { |_k, v| v.any? { |r| r[:issues].count.positive? } }
end