Class: Gizmo::Error
- Inherits:
-
Object
- Object
- Gizmo::Error
- Defined in:
- lib/gizmo/models/error.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#backtrace ⇒ Object
readonly
Returns the value of attribute backtrace.
-
#message ⇒ Object
readonly
Returns the value of attribute message.
Instance Method Summary collapse
- #as_json(opts = {}) ⇒ Object
-
#initialize(message, backtrace = nil) ⇒ Error
constructor
A new instance of Error.
Constructor Details
#initialize(message, backtrace = nil) ⇒ Error
Returns a new instance of Error.
5 6 7 8 |
# File 'lib/gizmo/models/error.rb', line 5 def initialize(, backtrace=nil) @message = @backtrace = backtrace end |
Instance Attribute Details
#backtrace ⇒ Object (readonly)
Returns the value of attribute backtrace.
3 4 5 |
# File 'lib/gizmo/models/error.rb', line 3 def backtrace @backtrace end |
#message ⇒ Object (readonly)
Returns the value of attribute message.
3 4 5 |
# File 'lib/gizmo/models/error.rb', line 3 def @message end |
Instance Method Details
#as_json(opts = {}) ⇒ Object
10 11 12 |
# File 'lib/gizmo/models/error.rb', line 10 def as_json(opts={}) {message: , backtrace: backtrace} end |