Class: Thread::Backtrace::PseudoLocation
Constant Summary collapse
- Pattern =
/\A(?'f'[^:]+)(?::(?'l'\d+))?(?::in `(?'m'.+)'|(?'m'.+))?\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
- #basename ⇒ Object
- #dirname ⇒ Object
-
#initialize(to_s) ⇒ PseudoLocation
constructor
A new instance of PseudoLocation.
- #realbasename ⇒ Object
- #realdirname ⇒ Object
- #realpath ⇒ Object
Constructor Details
#initialize(to_s) ⇒ PseudoLocation
Returns a new instance of PseudoLocation.
66 67 68 69 70 71 72 |
# File 'lib/pretty_debug.rb', line 66 def initialize to_s @to_s = to_s m = @to_s.match(Pattern) @absolute_path, @lineno, @label = m[:f], m[:l] ? m[:l].to_i : nil, m[:m].to_s @path = File.basename(@absolute_path) @base_label = @label end |
Instance Attribute Details
#absolute_path ⇒ Object
Returns the value of attribute absolute_path.
65 66 67 |
# File 'lib/pretty_debug.rb', line 65 def absolute_path @absolute_path end |
#base_label ⇒ Object
Returns the value of attribute base_label.
65 66 67 |
# File 'lib/pretty_debug.rb', line 65 def base_label @base_label end |
#label ⇒ Object
Returns the value of attribute label.
65 66 67 |
# File 'lib/pretty_debug.rb', line 65 def label @label end |
#lineno ⇒ Object
Returns the value of attribute lineno.
65 66 67 |
# File 'lib/pretty_debug.rb', line 65 def lineno @lineno end |
#path ⇒ Object
Returns the value of attribute path.
65 66 67 |
# File 'lib/pretty_debug.rb', line 65 def path @path end |
#to_s ⇒ Object
Returns the value of attribute to_s.
65 66 67 |
# File 'lib/pretty_debug.rb', line 65 def to_s @to_s end |
Instance Method Details
#basename ⇒ Object
74 |
# File 'lib/pretty_debug.rb', line 74 def basename; File.basename(absolute_path) end |
#dirname ⇒ Object
73 |
# File 'lib/pretty_debug.rb', line 73 def dirname; File.dirname(absolute_path) end |
#realbasename ⇒ Object
82 |
# File 'lib/pretty_debug.rb', line 82 def realbasename; File.basename(realpath) end |