Exception: Muwu::ProjectExceptionHandler::Fatal
- Inherits:
-
StandardError
- Object
- StandardError
- Muwu::ProjectExceptionHandler::Fatal
- Defined in:
- lib/muwu/project_exception_handler/fatal.rb
Instance Method Summary collapse
-
#initialize(exceptions) ⇒ Fatal
constructor
A new instance of Fatal.
- #render_exception(exception) ⇒ Object
- #render_exceptions ⇒ Object
- #render_header ⇒ Object
- #render_lf ⇒ Object
Constructor Details
#initialize(exceptions) ⇒ Fatal
Returns a new instance of Fatal.
6 7 8 9 10 |
# File 'lib/muwu/project_exception_handler/fatal.rb', line 6 def initialize(exceptions) @exceptions = [exceptions].flatten render_exceptions exit end |
Instance Method Details
#render_exception(exception) ⇒ Object
13 14 15 16 |
# File 'lib/muwu/project_exception_handler/fatal.rb', line 13 def render_exception(exception) $stderr.puts "- #{exception.class}" $stderr.puts " #{exception.report}" end |
#render_exceptions ⇒ Object
19 20 21 22 23 24 25 |
# File 'lib/muwu/project_exception_handler/fatal.rb', line 19 def render_exceptions render_header @exceptions.each do |exception| render_exception(exception) end render_lf end |
#render_header ⇒ Object
28 29 30 |
# File 'lib/muwu/project_exception_handler/fatal.rb', line 28 def render_header $stderr.puts "#{self.inspect}" end |
#render_lf ⇒ Object
33 34 35 |
# File 'lib/muwu/project_exception_handler/fatal.rb', line 33 def render_lf $stderr.puts "\n" end |