るりまサーチ

最速Rubyリファレンスマニュアル検索!
27件ヒット [1-27件を表示] (0.382秒)
トップページ > ライブラリ:ビルトイン[x] > クエリ:_builtin[x] > クエリ:compile[x] > クエリ:load_from_binary[x]

別のキーワード

  1. _builtin new
  2. _builtin inspect
  3. _builtin []
  4. _builtin to_s
  5. _builtin each

検索結果

RubyVM::InstructionSequence.load_from_binary(binary) -> RubyVM::InstructionSequence (26115.0)

RubyVM::InstructionSequence#to_binaryにより作られたバイナリフォーマットの文字列からiseqのオブジェクトをロードします。

...りません。自分が変換したバイナリデータを使うべきです。

//emlist[例][ruby]{
iseq = RubyVM::InstructionSequence.compile('num = 1 + 2')
binary = iseq.to_binary
RubyVM::InstructionSequence.load_from_binary(binary).eval # => 3
//}

@see RubyVM::InstructionSequence#to_binary...

RubyVM::InstructionSequence.load_from_binary_extra_data(binary) -> String (14115.0)

バイナリフォーマットの文字列から埋め込まれたextra_dataを取り出します。

...埋め込まれたextra_dataを取り出します。

//emlist[例][ruby]{
iseq = RubyVM::InstructionSequence.compile('num = 1 + 2')
binary = iseq.to_binary("extra_data")
RubyVM::InstructionSequence.load_from_binary_extra_data(binary) # => extra_data
//}

@see RubyVM::InstructionSequence#to_binary...

RubyVM::InstructionSequence#to_binary(extra_data = nil) -> String (8042.0)

バイナリフォーマットでシリアライズされたiseqのデータを文字列として返します。 RubyVM::InstructionSequence.load_from_binary メソッドでバイナリデータに対応するiseqオブジェクトを作れます。

...す。
RubyVM::InstructionSequence.load_from_binary メソッドでバイナリデータに対応するiseqオブジェクトを作れます。

引数の extra_data はバイナリデータと共に保存されます。
RubyVM::InstructionSequence.load_from_binary_extra_data メソッドでこの...
...ーキテクチャのRubyで作られたバイナリデータは使用できません。

//emlist[例][ruby]{
iseq = RubyVM::InstructionSequence.compile('num = 1 + 2')
iseq.to_binary("extra_data")

# ※表示の都合上改行しているが実際は改行はない
# => "YARB\x02\x00\x00\x00\x03\x...
...x00\x00\x00\x00\x00
# \xF1\x7F\x00\x00\b\x00\x00\x00\x00\x00\x00\x00E\x7F\x00\x00\x02\x00\x00\x00
# \x00\x00\x00\x00\n\x00\x00\x00\x00\x00\x00\x00<compiled>\xF5\x7F\x00\x00
# \x05\x00\x00\x00\x00\x00\x00\x00E\x7F\x00\x00\x02\x00\x00\x00\x00\x00\x00
# \x00\x03\x00\x00\x00\x00\x00\x00\x00numE\x7F\x00\...