Class: Thread::Backtrace::Location
Instance Attribute Summary collapse
-
#base_label ⇒ Object
readonly
Returns the value of attribute base_label.
-
#label ⇒ Object
readonly
Returns the value of attribute label.
-
#lineno ⇒ Object
readonly
Returns the value of attribute lineno.
-
#path ⇒ Object
(also: #absolute_path)
readonly
Returns the value of attribute path.
Instance Method Summary collapse
-
#initialize(str) ⇒ Location
constructor
A new instance of Location.
- #inspect ⇒ Object
- #to_s ⇒ Object
Constructor Details
#initialize(str) ⇒ Location
Returns a new instance of Location.
117 118 119 120 121 122 123 124 125 126 127 |
# File 'opal/stdlib/thread.rb', line 117 def initialize(str) @str = str str =~ /^(.*?):(\d+):(\d+):in `(.*?)'$/ @path = Regexp.last_match(1) @label = Regexp.last_match(4) @lineno = Regexp.last_match(2).to_i @label =~ /(\w+)$/ @base_label = Regexp.last_match(1) || @label end |
Instance Attribute Details
#base_label ⇒ Object (readonly)
Returns the value of attribute base_label.
137 138 139 |
# File 'opal/stdlib/thread.rb', line 137 def base_label @base_label end |
#label ⇒ Object (readonly)
Returns the value of attribute label.
137 138 139 |
# File 'opal/stdlib/thread.rb', line 137 def label @label end |
#lineno ⇒ Object (readonly)
Returns the value of attribute lineno.
137 138 139 |
# File 'opal/stdlib/thread.rb', line 137 def lineno @lineno end |
#path ⇒ Object (readonly) Also known as: absolute_path
Returns the value of attribute path.
137 138 139 |
# File 'opal/stdlib/thread.rb', line 137 def path @path end |