Skip to content

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

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'