Class: Lookout::Results::Error::Exception::Backtrace
- Defined in:
- lib/lookout/results/error/exception/backtrace.rb
Instance Method Summary collapse
- #backtrace ⇒ Object
-
#initialize(backtrace, filter = ENV['LOOKOUT_DO_NOT_FILTER_BACKTRACE'].nil?) ⇒ Backtrace
constructor
A new instance of Backtrace.
- #to_s ⇒ Object
Constructor Details
#initialize(backtrace, 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, filter = ENV['LOOKOUT_DO_NOT_FILTER_BACKTRACE'].nil?) @filter = filter @backtrace = case backtrace when nil then [] when String then [backtrace] when Array then backtrace.select{ |l| String === l } end end |
Instance Method Details
#backtrace ⇒ Object
13 14 15 16 |
# File 'lib/lookout/results/error/exception/backtrace.rb', line 13 def backtrace return @backtrace unless @filter before or outside or @backtrace end |
#to_s ⇒ Object
18 19 20 |
# File 'lib/lookout/results/error/exception/backtrace.rb', line 18 def to_s backtrace.map{ |location| "\tfrom %s" % location }.join("\n") end |