Parent

Files

HoptoadNotifier::Backtrace

Front end to parsing the backtrace for each notice

Attributes

lines[RW]

holder for an Array of Backtrace::Line instances

Public Class Methods

new(lines) click to toggle source
# File lib/hoptoad_notifier/backtrace.rb, line 71
def initialize(lines)
  self.lines = lines
end
parse(ruby_backtrace, opts = {}) click to toggle source
# File lib/hoptoad_notifier/backtrace.rb, line 54
def self.parse(ruby_backtrace, opts = {})
  ruby_lines = split_multiline_backtrace(ruby_backtrace)

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

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

  instance = new(lines)
end

Public Instance Methods

==(other) click to toggle source
# File lib/hoptoad_notifier/backtrace.rb, line 79
def ==(other)
  if other.respond_to?(:lines)
    lines == other.lines
  else
    false
  end
end
inspect() click to toggle source
# File lib/hoptoad_notifier/backtrace.rb, line 75
def inspect
  "<Backtrace: " + lines.collect { |line| line.inspect }.join(", ") + ">"
end

[Validate]

Generated with the Darkfish Rdoc Generator 2.