Preview Ruby 4.1 is a preview. It can change before the final release. Switch to Ruby 4.0 →
instance method
Ruby::SourceRange#inspect
source_range.inspect → String
proc.c
View on GitHub ↗
static VALUE
source_range_inspect(VALUE self)
{
struct source_range_data *data = source_range_data_get(self);
VALUE str = rb_str_new_cstr("#<Ruby::SourceRange ");
VALUE path = NIL_P(data->absolute_path) ? data->path : data->absolute_path;
VM_ASSERT(!NIL_P(path));
rb_str_append(str, path);
rb_str_catf(str, ":(%d,%d)-(%d,%d)>",
data->start_line, data->start_column,
data->end_line, data->end_column);
return str;
}
Returns a human-readable string with the absolute_path if available, otherwise the path, and the start and end coordinates.