Exception: MadderLib::Error
- Inherits:
-
Exception
- Object
- Exception
- MadderLib::Error
- Defined in:
- lib/madderlib/core.rb
Overview
Error
A Module-specific Exception class
– i would have called it MadderLib::Exception except that i don’t know how to access Kernel::Exception within the initialize logic ++
Instance Attribute Summary collapse
-
#cause ⇒ Object
readonly
The propagated cause of this Exception, if appropriate.
Instance Method Summary collapse
-
#initialize(message, cause = nil) ⇒ Error
constructor
Constructed with a message and an optional ‘causing’ Exception.
Constructor Details
#initialize(message, cause = nil) ⇒ Error
Constructed with a message and an optional ‘causing’ Exception.
If no message is passed – eg. only an Exception – then this Error inherits its message.
17 18 19 20 21 22 23 24 25 |
# File 'lib/madderlib/core.rb', line 17 def initialize(, cause=nil) if (Exception === ) super .to_s @cause = else super @cause = cause end end |
Instance Attribute Details
#cause ⇒ Object (readonly)
The propagated cause of this Exception, if appropriate
12 13 14 |
# File 'lib/madderlib/core.rb', line 12 def cause @cause end |