Chapter 14. YAML

image with no caption

At some point, most desktop applications are going to want to save and read structured data to and from disk. You’ve already seen how to read and write data using simple IO routines such as gets and puts. But how would you go about saving and restoring data from, say, lists of mixed object types? One simple way of doing this with Ruby is by using YAML.

Note

YAML is an acronym that is (debatably) either short for Yet Another Markup Language or (recursively) for YAML Ain’t Markup Language.

Converting to YAML

YAML defines a serialization (data-saving) format that stores information as human-readable text. YAML can be used with a variety ...

Get The Book of Ruby now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.