Exception: Muwu::ProjectExceptionHandler::Fatal

Inherits:
StandardError
  • Object
show all
Defined in:
lib/muwu/project_exception_handler/fatal.rb

Instance Method Summary collapse

Constructor Details

#initialize(exceptions) ⇒ Fatal

Returns a new instance of Fatal.



6
7
8
9
# File 'lib/muwu/project_exception_handler/fatal.rb', line 6

def initialize(exceptions)
  @exceptions = [exceptions].flatten
  render_exceptions
end

Instance Method Details

#render_exception(exception) ⇒ Object



12
13
14
15
# File 'lib/muwu/project_exception_handler/fatal.rb', line 12

def render_exception(exception)
  $stderr.puts "- #{exception.class}"
  $stderr.puts "  #{exception.report}"
end

#render_exceptionsObject



18
19
20
21
22
23
24
# File 'lib/muwu/project_exception_handler/fatal.rb', line 18

def render_exceptions
  render_header
  @exceptions.each do |exception|
    render_exception(exception)
  end
  render_lf
end

#render_headerObject



27
28
29
# File 'lib/muwu/project_exception_handler/fatal.rb', line 27

def render_header
  $stderr.puts "#{self.inspect}"
end

#render_lfObject



32
33
34
# File 'lib/muwu/project_exception_handler/fatal.rb', line 32

def render_lf
  $stderr.puts "\n"
end