Exception: Exception

Defined in:
lib/tagen/core/exception.rb

Overview

exit_code for shell programming.

end

Examples:


MyError = Class.new(Exception)
MyError.exit_code = 1

class MyError2 < Exception 
  @@eixt_code=1 
end

begin
  ...
rescue MyError => e
  p e.exit_code    -> 1

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.exit_codeObject



19
20
21
# File 'lib/tagen/core/exception.rb', line 19

def exit_code
  @@exit_code 
end

.exit_code=(code) ⇒ Object



23
24
25
# File 'lib/tagen/core/exception.rb', line 23

def exit_code=(code)
  @@exit_code = code
end

Instance Method Details

#exit_codeObject



28
29
30
# File 'lib/tagen/core/exception.rb', line 28

def exit_code
  self.class.exit_code
end