Exception: SystemExit

Inherits:
Exception show all
Defined in:
lib/laser/standard_library/exceptions.rb

Constant Summary

EXIT_SUCCESS =
0

Constants inherited from Exception

Exception::BT_FAILURE_MESSAGE

Instance Method Summary collapse

Methods inherited from Exception

#backtrace, #set_backtrace, #to_s

Constructor Details

#initialize(val = nil, msg = nil) ⇒ SystemExit

Returns a new instance of SystemExit



34
35
36
37
38
39
40
41
# File 'lib/laser/standard_library/exceptions.rb', line 34

def initialize(val=nil, msg=nil)
  if Fixnum === val
    @__status__ = val
    super(msg)
  else
    super(val)
  end
end

Instance Method Details

#statusObject



42
43
44
# File 'lib/laser/standard_library/exceptions.rb', line 42

def status
  @__status__
end

#success?Boolean

Returns:

  • (Boolean)


45
46
47
# File 'lib/laser/standard_library/exceptions.rb', line 45

def success?
  @__status__.nil? || @__status__ == EXIT_SUCCESS
end