Exception: RakeCommander::Base::CustomError
- Inherits:
-
StandardError
- Object
- StandardError
- RakeCommander::Base::CustomError
- Defined in:
- lib/rake-commander/base/custom_error.rb
Overview
Note:
Although not clearly explained, this is somehow captured here https://stackoverflow.com/a/32481520/4352306
This class allows to use both method calls to raise
by using additional parameters.
Direct Known Subclasses
Instance Method Summary collapse
-
#initialize(value = nil) ⇒ CustomError
constructor
A new instance of CustomError.
-
#message ⇒ Object
If @value was already set, ignore the latest message just return @message.
-
#to_s ⇒ Object
If @value was already set, ignore the latest message and just return @message.
Constructor Details
#initialize(value = nil) ⇒ CustomError
Returns a new instance of CustomError.
6 7 8 |
# File 'lib/rake-commander/base/custom_error.rb', line 6 def initialize(value = nil) super(@message = (value)) if @value = value end |
Instance Method Details
#message ⇒ Object
If @value was already set, ignore the latest message just return @message
19 20 21 22 |
# File 'lib/rake-commander/base/custom_error.rb', line 19 def return @message if @message (unclassed(super)) end |
#to_s ⇒ Object
If @value was already set, ignore the latest message and just return @message
12 13 14 15 |
# File 'lib/rake-commander/base/custom_error.rb', line 12 def to_s return @message if @message unclassed(super) end |