Deserialization.rb

This content was produced by an LLM and could include errors.

This script reads a serialized object from a file. It then uses Marshal.load to deserialize the binary data, successfully reconstructing the object into a readable Ruby Hash.

serialized_person = File.read('input/serialization/person.dat')
#=> "\u0004\b{\a:\tnameI\"\nAlice\u0006:\u0006ET:\bagei#"
Marshal.load(serialized_person)
#=> {name: "Alice", age: 30}

Ruby 4.0.3