D7net
Home
Console
Upload
information
Create File
Create Folder
About
Tools
:
/
proc
/
self
/
root
/
opt
/
alt
/
ruby34
/
share
/
ri
/
system
/
Marshal
/
Filename :
load-c.ri
back
Copy
U:RDoc::AnyMethod[iI" load:ETI"Marshal::load;TT:publico:RDoc::Markup::Document:@parts[o:RDoc::Markup::Paragraph; [ I"KReturns the result of converting the serialized data in source into a ;TI"HRuby object (possibly with associated subordinate objects). source ;TI"Cmay be either an instance of IO or an object that responds to ;TI"Yto_str. If proc is specified, each object will be passed to the proc, as the object ;TI"is being deserialized.;To:RDoc::Markup::BlankLine o; ; [I"ONever pass untrusted data (including user supplied input) to this method. ;TI"1Please see the overview for further details.;T@o; ; [I"PIf the <tt>freeze: true</tt> argument is passed, deserialized object would ;TI"Sbe deeply frozen. Note that it may lead to more efficient memory usage due to ;TI""frozen strings deduplication:;T@o:RDoc::Markup::Verbatim; [I"Iserialized = Marshal.dump(['value1', 'value2', 'value1', 'value2']) ;TI" ;TI"-deserialized = Marshal.load(serialized) ;TI"!deserialized.map(&:frozen?) ;TI"'# => [false, false, false, false] ;TI"#deserialized.map(&:object_id) ;TI"F# => [1023900, 1023920, 1023940, 1023960] -- 4 different objects ;TI" ;TI";deserialized = Marshal.load(serialized, freeze: true) ;TI"!deserialized.map(&:frozen?) ;TI"## => [true, true, true, true] ;TI"#deserialized.map(&:object_id) ;TI"`# => [1039360, 1039380, 1039360, 1039380] -- only 2 different objects, object_ids repeating;T:@format0: @fileI"marshal.rb;T:0@omit_headings_from_table_of_contents_below0I"fload(source, proc = nil, freeze: false) -> obj restore(source, proc = nil, freeze: false) -> obj ;T0[[I"restore;To;; [ ;@+;0I"((source, proc = nil, freeze: false);T@+FI"Marshal;TcRDoc::NormalModule00