Preview Ruby 4.1 is a preview. It can change before the final release. Switch to Ruby 4.0 →
instance method
Thread::Backtrace::Location#base_label
() -> ::String?
base_label
vm_backtrace.c
View on GitHub ↗
static VALUE
location_base_label_m(VALUE self)
{
return location_base_label(location_ptr(self));
}
Returns the base label of this frame, which is usually equal to the label, without decoration.
Consider the following example:
Example
def foo puts caller_locations(0).first.base_label 1.times do puts caller_locations(0).first.base_label 1.times do puts caller_locations(0).first.base_label end end end
The result of calling foo is this:
Example
foo foo foo