Skip to content

Maintenance Ruby 3.3 gets fixes, but no new features. Switch to Ruby 4.0 →

instance method

RubyVM::InstructionSequence#first_lineno

first_lineno

Returns the number of the first source line where the instruction sequence was loaded from.

For example, using irb:

Example
iseq = RubyVM::InstructionSequence.compile('num = 1 + 2')
#=> <RubyVM::InstructionSequence:<compiled>@<compiled>>
iseq.first_lineno
#=> 1
See also #eval #inspect #each_child #label also in 4.1 · 4.0 · 3.4 · 3.2 · 3.1 · 3.0