Class: Gruf::Errors::DebugInfo
- Inherits:
-
Object
- Object
- Gruf::Errors::DebugInfo
- Defined in:
- lib/gruf/errors/debug_info.rb
Overview
Represents debugging information
Instance Attribute Summary collapse
-
#detail ⇒ Object
readonly
Returns the value of attribute detail.
-
#stack_trace ⇒ Object
readonly
Returns the value of attribute stack_trace.
Instance Method Summary collapse
-
#initialize(detail, stack_trace = []) ⇒ DebugInfo
constructor
A new instance of DebugInfo.
- #to_h ⇒ Hash
Constructor Details
#initialize(detail, stack_trace = []) ⇒ DebugInfo
Returns a new instance of DebugInfo.
29 30 31 32 |
# File 'lib/gruf/errors/debug_info.rb', line 29 def initialize(detail, stack_trace = []) @detail = detail @stack_trace = stack_trace.is_a?(String) ? stack_trace.split("\n") : stack_trace end |
Instance Attribute Details
#detail ⇒ Object (readonly)
Returns the value of attribute detail.
23 24 25 |
# File 'lib/gruf/errors/debug_info.rb', line 23 def detail @detail end |
#stack_trace ⇒ Object (readonly)
Returns the value of attribute stack_trace.
23 24 25 |
# File 'lib/gruf/errors/debug_info.rb', line 23 def stack_trace @stack_trace end |
Instance Method Details
#to_h ⇒ Hash
37 38 39 40 41 42 |
# File 'lib/gruf/errors/debug_info.rb', line 37 def to_h { detail: detail, stack_trace: stack_trace } end |