Class: Backtracie::Location
- Inherits:
-
Object
- Object
- Backtracie::Location
- Defined in:
- lib/backtracie/location.rb
Overview
A more advanced version of Ruby’s built-in Thread::Backtrace::Location
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.
Instance Method Summary collapse
-
#initialize(absolute_path, base_label, label, lineno, path, debug) ⇒ Location
constructor
Note: The order of arguments is hardcoded in the native extension in the ‘new_location` function – keep them in sync.
- #to_s ⇒ Object
Constructor Details
#initialize(absolute_path, base_label, label, lineno, path, debug) ⇒ Location
Note: The order of arguments is hardcoded in the native extension in the ‘new_location` function – keep them in sync
32 33 34 35 36 37 38 39 40 41 |
# File 'lib/backtracie/location.rb', line 32 def initialize(absolute_path, base_label, label, lineno, path, debug) @absolute_path = absolute_path @base_label = base_label @label = label @lineno = lineno @path = path @debug = debug freeze end |
Instance Attribute Details
#absolute_path ⇒ Object
Returns the value of attribute absolute_path.
24 25 26 |
# File 'lib/backtracie/location.rb', line 24 def absolute_path @absolute_path end |
#base_label ⇒ Object
Returns the value of attribute base_label.
25 26 27 |
# File 'lib/backtracie/location.rb', line 25 def base_label @base_label end |
#label ⇒ Object
Returns the value of attribute label.
26 27 28 |
# File 'lib/backtracie/location.rb', line 26 def label @label end |
#lineno ⇒ Object
Returns the value of attribute lineno.
27 28 29 |
# File 'lib/backtracie/location.rb', line 27 def lineno @lineno end |
#path ⇒ Object
Returns the value of attribute path.
28 29 30 |
# File 'lib/backtracie/location.rb', line 28 def path @path end |
Instance Method Details
#to_s ⇒ Object
43 44 45 46 47 48 49 |
# File 'lib/backtracie/location.rb', line 43 def to_s if @lineno != 0 "#{@path}:#{@lineno}:in `#{@label}'" else "#{@path}:in `#{@label}'" end end |