End of Life Ruby 3.1 has reached end of life and gets no more fixes. Switch to Ruby 4.0 →
instance method
RubyVM::InstructionSequence#first_lineno
first_lineno
iseq.c
View on GitHub ↗
static VALUE
iseqw_first_lineno(VALUE self)
{
return rb_iseq_first_lineno(iseqw_check(self));
}
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