Class: Crashdesk::Backtrace::Line
- Inherits:
-
Object
- Object
- Crashdesk::Backtrace::Line
- Defined in:
- lib/crashdesk/backtrace.rb
Constant Summary collapse
- INPUT_FORMAT =
regexp taken from Airbrake
%r{^((?:[a-zA-Z]:)?[^:]+):(\d+)(?::in `([^']+)')?$}.freeze
Instance Attribute Summary collapse
-
#file ⇒ Object
readonly
Returns the value of attribute file.
-
#method ⇒ Object
readonly
Returns the value of attribute method.
-
#number ⇒ Object
readonly
Returns the value of attribute number.
Class Method Summary collapse
Instance Method Summary collapse
- #==(other) ⇒ Object
-
#initialize(file, number, method) ⇒ Line
constructor
A new instance of Line.
- #inspect ⇒ Object
- #to_s ⇒ Object
Constructor Details
#initialize(file, number, method) ⇒ Line
Returns a new instance of Line.
19 20 21 22 23 |
# File 'lib/crashdesk/backtrace.rb', line 19 def initialize(file, number, method) self.file = file self.number = number self.method = method end |
Instance Attribute Details
#file ⇒ Object
Returns the value of attribute file.
12 13 14 |
# File 'lib/crashdesk/backtrace.rb', line 12 def file @file end |
#method ⇒ Object
Returns the value of attribute method.
12 13 14 |
# File 'lib/crashdesk/backtrace.rb', line 12 def method @method end |
#number ⇒ Object
Returns the value of attribute number.
12 13 14 |
# File 'lib/crashdesk/backtrace.rb', line 12 def number @number end |
Class Method Details
.parse(unparsed_line) ⇒ Object
14 15 16 17 |
# File 'lib/crashdesk/backtrace.rb', line 14 def self.parse(unparsed_line) _, file, number, method = unparsed_line.match(INPUT_FORMAT).to_a new(file, number, method) end |
Instance Method Details
#==(other) ⇒ Object
29 30 31 |
# File 'lib/crashdesk/backtrace.rb', line 29 def ==(other) to_s == other.to_s end |
#inspect ⇒ Object
33 34 35 |
# File 'lib/crashdesk/backtrace.rb', line 33 def inspect "<Line:#{to_s}>" end |
#to_s ⇒ Object
25 26 27 |
# File 'lib/crashdesk/backtrace.rb', line 25 def to_s "#{file}:#{number}:in `#{method}'" end |