Class: Releaseko::CustomError
- Inherits:
-
Object
- Object
- Releaseko::CustomError
- Defined in:
- lib/releaseko/custom_error.rb
Overview
Custom Error object for Releaseko
Instance Attribute Summary collapse
-
#code ⇒ Object
readonly
Returns the value of attribute code.
-
#message ⇒ Object
readonly
Returns the value of attribute message.
Instance Method Summary collapse
- #complain ⇒ Object
-
#initialize(message, code = 1) ⇒ CustomError
constructor
A new instance of CustomError.
Constructor Details
#initialize(message, code = 1) ⇒ CustomError
Returns a new instance of CustomError.
8 9 10 11 |
# File 'lib/releaseko/custom_error.rb', line 8 def initialize(, code = 1) @message = @code = code end |
Instance Attribute Details
#code ⇒ Object (readonly)
Returns the value of attribute code.
6 7 8 |
# File 'lib/releaseko/custom_error.rb', line 6 def code @code end |
#message ⇒ Object (readonly)
Returns the value of attribute message.
6 7 8 |
# File 'lib/releaseko/custom_error.rb', line 6 def @message end |
Instance Method Details
#complain ⇒ Object
13 14 15 16 |
# File 'lib/releaseko/custom_error.rb', line 13 def complain puts "Error occurred!\n#{}\nExit code #{code}" exit(code) end |