path

path()
Instance Public methods

Returns the path of this instruction sequence.

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

For example, using irb:

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

Using ::compile_file:

1
2
3
4
5
6
7
8
# /tmp/method.rb
def hello
  puts "hello, world"
end
 
# in irb
> iseq = RubyVM::InstructionSequence.compile_file('/tmp/method.rb')
> iseq.path #=> /tmp/method.rb
doc_ruby_on_rails
2025-01-10 15:47:30
Comments
Leave a Comment

Please login to continue.