Class: Zold::Backtrace

Inherits:
Object
  • Object
show all
Defined in:
lib/zold/backtrace.rb

Overview

Backtrace of an exception

Instance Method Summary collapse

Constructor Details

#initialize(error) ⇒ Backtrace

Returns a new instance of Backtrace.


28
29
30
# File 'lib/zold/backtrace.rb', line 28

def initialize(error)
  @error = error
end

Instance Method Details

#to_sObject


32
33
34
35
36
37
38
39
40
# File 'lib/zold/backtrace.rb', line 32

def to_s
  [
    @error.class.name,
    ': ',
    @error.message,
    "\n\t",
    @error.backtrace.select { |t| t.include?('zold/') }.join("\n\t")
  ].join
end