class Renegade::HandleErrors
Handle errors
Public Class Methods
handle_errors(errors)
click to toggle source
Handle errors if they exist
# File lib/renegade/handle_errors.rb, line 6 def self.handle_errors(errors) if errors.empty? true else print_errors(errors) false end end
handle_warnings(warnings)
click to toggle source
# File lib/renegade/handle_errors.rb, line 15 def self.handle_warnings(warnings) print_warnings(warnings) unless warnings.empty? end
print_errors(errors)
click to toggle source
# File lib/renegade/handle_errors.rb, line 19 def self.print_errors(errors) puts "\nErrors:" errors.each do |error| puts "- #{error}" end puts "\n" end
print_warnings(warnings)
click to toggle source
# File lib/renegade/handle_errors.rb, line 29 def self.print_warnings(warnings) puts "\nWarnings:" warnings.each do |warning| puts "- #{warning}" end puts "\n" end