Class: Panda::Error
- Inherits:
-
Object
- Object
- Panda::Error
- Defined in:
- lib/panda/error.rb
Instance Attribute Summary collapse
-
#error_class ⇒ Object
readonly
Returns the value of attribute error_class.
-
#message ⇒ Object
readonly
Returns the value of attribute message.
-
#original_hash ⇒ Object
readonly
Returns the value of attribute original_hash.
Instance Method Summary collapse
-
#initialize(options) ⇒ Error
constructor
A new instance of Error.
- #raise! ⇒ Object
- #to_s ⇒ Object
Constructor Details
#initialize(options) ⇒ Error
Returns a new instance of Error.
7 8 9 10 11 |
# File 'lib/panda/error.rb', line 7 def initialize() @original_hash = @message = ['message'] @error_class = ['error'] end |
Instance Attribute Details
#error_class ⇒ Object (readonly)
Returns the value of attribute error_class.
4 5 6 |
# File 'lib/panda/error.rb', line 4 def error_class @error_class end |
#message ⇒ Object (readonly)
Returns the value of attribute message.
3 4 5 |
# File 'lib/panda/error.rb', line 3 def @message end |
#original_hash ⇒ Object (readonly)
Returns the value of attribute original_hash.
5 6 7 |
# File 'lib/panda/error.rb', line 5 def original_hash @original_hash end |
Instance Method Details
#raise! ⇒ Object
13 14 15 |
# File 'lib/panda/error.rb', line 13 def raise! raise(self.to_s) end |
#to_s ⇒ Object
17 18 19 |
# File 'lib/panda/error.rb', line 17 def to_s "#{@error_class}: #{@message}" end |