Class: Thread::Backtrace::PseudoLocation
Constant Summary collapse
- Pattern =
/\A(?'f'.+?):(?'li'\d+)(?::in `(?'lb'.*)'|(?'lb'.*))?\z/m
Instance Attribute Summary collapse
-
#absolute_path ⇒ Object
Returns the value of attribute absolute_path.
-
#base_label ⇒ Object
Returns the value of attribute base_label.
-
#label ⇒ Object
Returns the value of attribute label.
-
#lineno ⇒ Object
Returns the value of attribute lineno.
-
#path ⇒ Object
Returns the value of attribute path.
-
#to_s ⇒ Object
Returns the value of attribute to_s.
Instance Method Summary collapse
-
#initialize(to_s) ⇒ PseudoLocation
constructor
A new instance of PseudoLocation.
Constructor Details
#initialize(to_s) ⇒ PseudoLocation
Returns a new instance of PseudoLocation.
16 17 18 19 20 21 22 |
# File 'lib/pretty_debug.rb', line 16 def initialize to_s @to_s = to_s @absolute_path, @lineno, @label = @to_s.match(Pattern).chain{|m| [m[:f], m[:li].to_i, m[:lb]]} @path = File.basename(@absolute_path) @base_label = @label.gsub(/\Ablock in /, "") end |
Instance Attribute Details
#absolute_path ⇒ Object
Returns the value of attribute absolute_path.
15 16 17 |
# File 'lib/pretty_debug.rb', line 15 def absolute_path @absolute_path end |
#base_label ⇒ Object
Returns the value of attribute base_label.
15 16 17 |
# File 'lib/pretty_debug.rb', line 15 def base_label @base_label end |
#label ⇒ Object
Returns the value of attribute label.
15 16 17 |
# File 'lib/pretty_debug.rb', line 15 def label @label end |
#lineno ⇒ Object
Returns the value of attribute lineno.
15 16 17 |
# File 'lib/pretty_debug.rb', line 15 def lineno @lineno end |
#path ⇒ Object
Returns the value of attribute path.
15 16 17 |
# File 'lib/pretty_debug.rb', line 15 def path @path end |
#to_s ⇒ Object
Returns the value of attribute to_s.
15 16 17 |
# File 'lib/pretty_debug.rb', line 15 def to_s @to_s end |