Class: Radar::Backtrace::Entry

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

Overview

Represents a single line of a backtrace, giving access to the file, line, and method.

Instance Method Summary collapse

Constructor Details

#initialize(line) ⇒ Entry

Returns a new instance of Entry.



26
27
28
29
30
31
32
# File 'lib/radar/backtrace.rb', line 26

def initialize(line)
  # Regex pulled from HoptoadNotifier. Thanks!
  _, file, line, method = line.match(/^([^:]+):(\d+)(?::in `([^']+)')?$/).to_a
  self[:file] = file
  self[:line] = line
  self[:method] = method
end