るりまサーチ

最速Rubyリファレンスマニュアル検索!
11件ヒット [1-11件を表示] (0.046秒)
トップページ > クエリ:String[x] > クエリ:remove_const[x] > クエリ:Marshal フォーマット[x]

別のキーワード

  1. _builtin marshal_dump
  2. win32ole const_load
  3. pstore empty_marshal_data
  4. _builtin marshal_load
  5. pstore empty_marshal_checksum

検索結果

Marshal フォーマット (15087.0)

Marshal フォーマット フォーマットバージョン 4.8 を元に記述しています。

...Marshal フォーマット
フォーマットバージョン 4.8 を元に記述しています。

=== nil, true, false

それぞれ、'0', 'T', 'F' になります。

//emlist[][ruby]{
p Marshal.dump(nil).unpack1("x2 a*") # => "0"
p Marshal.dump(true).unpack1("x2 a*") # => "T"
p Marshal.dump...
...ss

==== String, Regexp, Array, Hash のサブクラス (インスタンス変数なし)

'C' で始まるデータ構造になります。

//emlist{
| 'C' | クラス名(Symbol)の dump | 親クラスのインスタンスの dump |
//}

//emlist[例 1][ruby]{
class Foo < Array # (or String, Regexp...
...tance_eval { @bar } # => 1
File.open('testfile', 'wb') do |f|
Marshal.dump(Bar, f)
end

# 別プログラム相当にするため remove_const
Object.send :remove_const, :Bar

module Bar
end

p bar = Marshal.load(File.binread('testfile'))
p bar.instance_eval { @bar }
# => nil
//}

//emlist[例 3:...