Class: Klenod::Runtime::BacktraceRewriter::ParsedBacktraceEntry

Inherits:
Data
  • Object
show all
Defined in:
lib/klenod/runtime/backtrace_rewriter.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#descriptionObject (readonly)

Returns the value of attribute description

Returns:

  • (Object)

    the current value of description



19
20
21
# File 'lib/klenod/runtime/backtrace_rewriter.rb', line 19

def description
  @description
end

#fileObject (readonly)

Returns the value of attribute file

Returns:

  • (Object)

    the current value of file



19
20
21
# File 'lib/klenod/runtime/backtrace_rewriter.rb', line 19

def file
  @file
end

#lineObject (readonly)

Returns the value of attribute line

Returns:

  • (Object)

    the current value of line



19
20
21
# File 'lib/klenod/runtime/backtrace_rewriter.rb', line 19

def line
  @line
end

Class Method Details

.parse(line) ⇒ Object



21
22
23
24
25
26
27
28
29
30
# File 'lib/klenod/runtime/backtrace_rewriter.rb', line 21

def self.parse(line)
  case line
  in BacktraceString
    line.parsed_backtrace_entry
  in /\A(?<file>.*):(?<line>\d+):in '(?<description>.*)'\z/
    new($~[:file], $~[:line].to_i, $~[:description])
  else
    nil
  end
end

Instance Method Details

#to_backtrace_stringObject



36
37
38
# File 'lib/klenod/runtime/backtrace_rewriter.rb', line 36

def to_backtrace_string
  BacktraceString.new(self)
end

#to_sObject



32
33
34
# File 'lib/klenod/runtime/backtrace_rewriter.rb', line 32

def to_s
  "#{file}:#{line}:in '#{description}'"
end