Preview Ruby 4.1 is a preview. It can change before the final release. Switch to Ruby 4.0 →
instance method
Ruby::SourceRange#start_column
source_range.start_column → Integer
proc.c
View on GitHub ↗
static VALUE
source_range_start_column(VALUE self)
{
return INT2NUM(source_range_data_get(self)->start_column);
}
Returns the 0-indexed byte column where this source range starts.
Example
-> {}.source_range.start_column # => 0 # the '->' l = -> {}.source_range.start_column # => 4 # the '->' proc {}.source_range.start_column # => 5 # the '{' method(def m = 42).source_range.start_column # => 7 # the 'def'