Skip to content

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

instance method

RubyVM::InstructionSequence#to_binary

iseq.to_binary(extra_data = nil) → binary str

Returns serialized iseq binary format data as a String object. A corresponding iseq object is created by RubyVM::InstructionSequence.load_from_binary() method.

String extra_data will be saved with binary data. You can access this data with RubyVM::InstructionSequence.load_from_binary_extra_data(binary).

Note that the translated binary data is not portable. You can not move this binary data to another machine. You can not use the binary data which is created by another version/another architecture of Ruby.

See also #to_a #trace_points #path also in 4.1 · 4.0 · 3.4 · 3.3 · 3.2 · 3.1