Class: Gruf::Errors::DebugInfo

Inherits:
Object
  • Object
show all
Defined in:
lib/gruf/errors/debug_info.rb

Overview

Represents debugging information

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(detail, stack_trace = []) ⇒ DebugInfo

Returns a new instance of DebugInfo.

Parameters:

  • detail (String)
  • stack_trace (Array<String>) (defaults to: [])


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

#detailObject (readonly)

Returns the value of attribute detail.



23
24
25
# File 'lib/gruf/errors/debug_info.rb', line 23

def detail
  @detail
end

#stack_traceObject (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_hHash

Returns:

  • (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