Skip to content

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

class method

Marshal.load

load( source [, proc] ) → obj
restore( source [, proc] ) → obj

Returns the result of converting the serialized data in source into a Ruby object (possibly with associated subordinate objects). source may be either an instance of IO or an object that responds to to_str. If proc is specified, each object will be passed to the proc, as the object is being deserialized.

Never pass untrusted data (including user supplied input) to this method. Please see the overview for further details.

See also .dump .restore also in 4.1 · 4.0 · 3.4 · 3.3 · 3.2 · 3.1