Class: Lookout::Results::Error::Exception::Backtrace

Inherits:
Object
  • Object
show all
Defined in:
lib/lookout/results/error/exception/backtrace.rb

Instance Method Summary collapse

Constructor Details

#initialize(backtrace, trim, filter = ENV['LOOKOUT_DO_NOT_FILTER_BACKTRACE'].nil?) ⇒ Backtrace

Returns a new instance of Backtrace.



4
5
6
7
8
9
10
11
# File 'lib/lookout/results/error/exception/backtrace.rb', line 4

def initialize(backtrace, trim, filter = ENV['LOOKOUT_DO_NOT_FILTER_BACKTRACE'].nil?)
  @backtrace = case backtrace
               when nil then []
               when String then [backtrace]
               when Array then backtrace.select{ |l| String === l }
               end
  @trim, @filter = trim, filter
end

Instance Method Details

#to_sObject



13
14
15
# File 'lib/lookout/results/error/exception/backtrace.rb', line 13

def to_s
  trim(backtrace.map{ |location| "\tfrom %s" % location }).join("\n")
end