Skip to content
instance method

RubyVM::InstructionSequence#path

() -> ::String
path

Returns the path of this instruction sequence.

<compiled> if the iseq was evaluated from a string.

For example, using irb:

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

Using ::compile_file:

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

# in irb
> iseq = RubyVM::InstructionSequence.compile_file('/tmp/method.rb')
> iseq.path #=> /tmp/method.rb
See also #label #script_lines #inspect #to_a also in 4.1 · 3.4 · 3.3 · 3.2 · 3.1 · 3.0