Class: Stellwerk::Printer
- Inherits:
-
Object
- Object
- Stellwerk::Printer
- Defined in:
- lib/stellwerk/printer.rb
Instance Method Summary collapse
-
#initialize(violations) ⇒ Printer
constructor
A new instance of Printer.
- #print ⇒ Object
Constructor Details
#initialize(violations) ⇒ Printer
3 4 5 |
# File 'lib/stellwerk/printer.rb', line 3 def initialize(violations) @violations = violations end |
Instance Method Details
#print ⇒ Object
7 8 9 10 11 12 13 14 15 16 |
# File 'lib/stellwerk/printer.rb', line 7 def print puts "\nFound #{@violations.length} violations." @violations.group_by { |violation| violation.rule }.each do |rule, violations| puts "#{rule.name.titleize} rule violations:" violations.each do |violation| puts " " + format_reference(violation.reference) end end end |