Method: RubyVM::InstructionSequence#path

Defined in:
iseq.c

#pathObject

Returns the path of this instruction sequence.

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

For example, using irb:

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



848
849
850
851
852
853
854
# File 'iseq.c', line 848

VALUE
rb_iseq_path(VALUE self)
{
    rb_iseq_t *iseq;
    GetISeqPtr(self, iseq);
    return iseq->location.path;
}