What does “serialization” refer to?
The conversion of an object into a representation that can be stored on a disk or sent over a network.
What is the most common form of serialization on the web?
JSON
How can a Ruby object be serialized into JSON?
Include the ‘json’ gem, then use JSON::parse on the basic class (hash, array, etc.)
What is the best way to serialize a custom Ruby class or complex object?
Use YAML
How do we use YAML to serialize?
Require the ‘yaml’ gem, the use Object#to_yaml
How do we use YAML to deserialize?
Require the ‘yaml’ gem, then use YAML::load(yaml_string)