Class: Flatware::SerializedException
- Inherits:
-
Object
- Object
- Flatware::SerializedException
- Defined in:
- lib/flatware/serialized_exception.rb
Instance Attribute Summary collapse
-
#backtrace ⇒ Object
Returns the value of attribute backtrace.
-
#cause ⇒ Object
readonly
Returns the value of attribute cause.
-
#class ⇒ Object
readonly
Returns the value of attribute class.
-
#message ⇒ Object
readonly
Returns the value of attribute message.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(klass, message, backtrace, cause = nil) ⇒ SerializedException
constructor
A new instance of SerializedException.
Constructor Details
#initialize(klass, message, backtrace, cause = nil) ⇒ SerializedException
Returns a new instance of SerializedException.
6 7 8 9 10 11 |
# File 'lib/flatware/serialized_exception.rb', line 6 def initialize(klass, , backtrace, cause = nil) @class = serialized(klass) @message = @backtrace = backtrace @cause = cause && SerializedException.from(cause) end |
Instance Attribute Details
#backtrace ⇒ Object
Returns the value of attribute backtrace.
4 5 6 |
# File 'lib/flatware/serialized_exception.rb', line 4 def backtrace @backtrace end |
#cause ⇒ Object (readonly)
Returns the value of attribute cause.
3 4 5 |
# File 'lib/flatware/serialized_exception.rb', line 3 def cause @cause end |
#class ⇒ Object (readonly)
Returns the value of attribute class.
3 4 5 |
# File 'lib/flatware/serialized_exception.rb', line 3 def class @class end |
#message ⇒ Object (readonly)
Returns the value of attribute message.
3 4 5 |
# File 'lib/flatware/serialized_exception.rb', line 3 def @message end |
Class Method Details
.from(exception) ⇒ Object
13 14 15 16 17 18 19 20 |
# File 'lib/flatware/serialized_exception.rb', line 13 def self.from(exception) new( exception.class, exception., exception.backtrace, exception.cause ) end |