Class: Thread::Backtrace::PseudoLocation

Inherits:
Object
  • Object
show all
Defined in:
lib/pretty_debug.rb

Constant Summary collapse

Pattern =
/\A(?'f'[^:]+)(?::(?'l'\d+))?(?::in `(?'m'.+)'|(?'m'.+))?\z/m

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(to_s) ⇒ PseudoLocation



87
88
89
90
91
92
93
# File 'lib/pretty_debug.rb', line 87

def initialize to_s
  @to_s = to_s
  @absolute_path, @lineno, @label =
  @to_s.match(Pattern).chain{|m| [m[:f], m[:l].chain{|l| l.to_i if l}, m[:m].to_s]}
  @path = File.basename(@absolute_path)
  @base_label = @label
end

Instance Attribute Details

#absolute_pathObject

Returns the value of attribute absolute_path.



86
87
88
# File 'lib/pretty_debug.rb', line 86

def absolute_path
  @absolute_path
end

#base_labelObject

Returns the value of attribute base_label.



86
87
88
# File 'lib/pretty_debug.rb', line 86

def base_label
  @base_label
end

#labelObject

Returns the value of attribute label.



86
87
88
# File 'lib/pretty_debug.rb', line 86

def label
  @label
end

#linenoObject

Returns the value of attribute lineno.



86
87
88
# File 'lib/pretty_debug.rb', line 86

def lineno
  @lineno
end

#pathObject

Returns the value of attribute path.



86
87
88
# File 'lib/pretty_debug.rb', line 86

def path
  @path
end

#to_sObject

Returns the value of attribute to_s.



86
87
88
# File 'lib/pretty_debug.rb', line 86

def to_s
  @to_s
end