Class: Chutney::Formatter
- Inherits:
-
Object
- Object
- Chutney::Formatter
- Defined in:
- lib/chutney/formatter.rb
Overview
base class for all formatters
Direct Known Subclasses
Instance Attribute Summary collapse
-
#results ⇒ Object
Returns the value of attribute results.
Instance Method Summary collapse
- #files ⇒ Object
- #files_with_issues ⇒ Object
-
#initialize ⇒ Formatter
constructor
A new instance of Formatter.
Constructor Details
#initialize ⇒ Formatter
Returns a new instance of Formatter.
8 9 10 |
# File 'lib/chutney/formatter.rb', line 8 def initialize @results = {} end |
Instance Attribute Details
#results ⇒ Object
Returns the value of attribute results.
6 7 8 |
# File 'lib/chutney/formatter.rb', line 6 def results @results end |
Instance Method Details
#files ⇒ Object
12 13 14 |
# File 'lib/chutney/formatter.rb', line 12 def files results.map { |k, _v| k } end |
#files_with_issues ⇒ Object
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 |