class Audiothority::Summary

Public Class Methods

new(state) click to toggle source
# File lib/audiothority/summary.rb, line 5
def initialize(state)
  @state = state
end

Public Instance Methods

display(console) click to toggle source
# File lib/audiothority/summary.rb, line 9
def display(console)
  if @state.any?
    @state.each do |path, violations|
      console.say %(#{path} is inconsistent due to:)
      violations.each do |violation|
        checkmark = console.set_color(%(  ✗ ), :red, :bold)
        console.say(checkmark + violation.message)
      end
    end
  else
    checkmark = console.set_color(%(  ✓ ), :green, :bold)
    console.say(checkmark + %(All is good))
  end
end