Skip to content

End of Life Ruby 3.2 has reached end of life and gets no more fixes. Switch to Ruby 4.0 →

instance method

RubyVM::InstructionSequence#base_label

base_label

Returns the base label of this instruction sequence.

For example, using irb:

Example
iseq = RubyVM::InstructionSequence.compile('num = 1 + 2')
#=> <RubyVM::InstructionSequence:<compiled>@<compiled>>
iseq.base_label
#=> "<compiled>"

Using ::compile_file:

# /tmp/method.rb
def hello
  puts "hello, world"
end

# in irb
> iseq = RubyVM::InstructionSequence.compile_file('/tmp/method.rb')
> iseq.base_label #=> <main>
See also #absolute_path #disasm .of #disassemble also in 4.1 · 4.0 · 3.4 · 3.3 · 3.1 · 3.0