# class Raven::Backtrace

Front end to parsing the backtrace for each notice

### Constants

APP_DIRS_PATTERN

### Attributes

lines[RW]

holder for an `Array` of `Backtrace::Line` instances

### Public Class Methods

new(lines) click to toggle source

    # File sentry-raven/lib/raven/backtrace.rb, line 113
    def initialize(lines)
      self.lines = lines
    end

parse(backtrace, opts = {}) click to toggle source

    # File sentry-raven/lib/raven/backtrace.rb, line 94
    def self.parse(backtrace, opts = {})
      ruby_lines = backtrace.is_a?(Array) ? backtrace : backtrace.split(/\n\s*/)

      ruby_lines = opts[:configuration].backtrace_cleanup_callback.call(ruby_lines) if opts[:configuration]&.backtrace_cleanup_callback

      filters = opts[:filters] || []
      filtered_lines = ruby_lines.to_a.map do |line|
        filters.reduce(line) do |nested_line, proc|
          proc.call(nested_line)
        end
      end.compact

      lines = filtered_lines.map do |unparsed_line|
        Line.parse(unparsed_line)
      end

      new(lines)
    end

### Public Instance Methods

==(other) click to toggle source

    # File sentry-raven/lib/raven/backtrace.rb, line 129
    def ==(other)
      if other.respond_to?(:lines)
        lines == other.lines
      else
        false
      end
    end

inspect() click to toggle source

    # File sentry-raven/lib/raven/backtrace.rb, line 117
    def inspect
      "<Backtrace: " + lines.map(&:inspect).join(", ") + ">"
    end

to_s() click to toggle source

    # File sentry-raven/lib/raven/backtrace.rb, line 121
    def to_s
      content = []
      lines.each do |line|
        content << line
      end
      content.join("\n")
    end