Class: Thread::Backtrace::Location
Instance Method Summary collapse
-
#absolute_path ⇒ Object
Returns the full file path of this frame.
-
#base_label ⇒ Object
Returns the base label of this frame.
-
#inspect ⇒ Object
Returns the same as calling
inspect
on the string representation of #to_str. -
#label ⇒ Object
Returns the label of this frame.
-
#lineno ⇒ Object
Returns the line number of this frame.
-
#path ⇒ Object
Returns the file name of this frame.
-
#to_s ⇒ Object
Returns a Kernel#caller style string representing this frame.
Instance Method Details
#absolute_path ⇒ Object
Returns the full file path of this frame.
Same as #path, but includes the absolute path.
275 276 277 278 279 |
# File 'vm_backtrace.c', line 275
static VALUE
location_absolute_path_m(VALUE self)
{
return location_absolute_path(location_ptr(self));
}
|
#base_label ⇒ Object
Returns the base label of this frame.
Usually same as #label, without decoration.
212 213 214 215 216 |
# File 'vm_backtrace.c', line 212
static VALUE
location_base_label_m(VALUE self)
{
return location_base_label(location_ptr(self));
}
|
#inspect ⇒ Object
Returns the same as calling inspect
on the string representation of #to_str
346 347 348 349 350 |
# File 'vm_backtrace.c', line 346
static VALUE
location_inspect_m(VALUE self)
{
return rb_str_inspect(location_to_str(location_ptr(self)));
}
|
#label ⇒ Object
Returns the label of this frame.
Usually consists of method, class, module, etc names with decoration.
For example, using caller_locations.rb
from Thread::Backtrace::Location
loc = c(0..1).first loc.label #=> a
185 186 187 188 189 |
# File 'vm_backtrace.c', line 185
static VALUE
location_label_m(VALUE self)
{
return location_label(location_ptr(self));
}
|
#lineno ⇒ Object
Returns the line number of this frame.
For example, using caller_locations.rb
from Thread::Backtrace::Location
loc = c(0..1).first loc.lineno #=> 2
153 154 155 156 157 |
# File 'vm_backtrace.c', line 153
static VALUE
location_lineno_m(VALUE self)
{
return INT2FIX(location_lineno(location_ptr(self)));
}
|
#path ⇒ Object
Returns the file name of this frame.
For example, using caller_locations.rb
from Thread::Backtrace::Location
loc = c(0..1).first loc.path #=> caller_locations.rb
245 246 247 248 249 |
# File 'vm_backtrace.c', line 245
static VALUE
location_path_m(VALUE self)
{
return location_path(location_ptr(self));
}
|
#to_s ⇒ Object
Returns a Kernel#caller style string representing this frame.
336 337 338 339 340 |
# File 'vm_backtrace.c', line 336
static VALUE
location_to_str_m(VALUE self)
{
return location_to_str(location_ptr(self));
}
|