YAML
The YAML library, available with require "yaml", serializes and deserializes Ruby object trees to and from an external, readable, plain-text format. YAML can be used as a portable object marshaling scheme, allowing objects to be passed in plain text between separate Ruby processes. In some cases, objects may also be exchanged between Ruby programs and programs in other languages that also have YAML support.
The YAML module in Ruby is an alias to Psych, which is the name of the YAML parser being used. We mention this because it may be easier to find further documentation searching for Psych rather than YAML.
Writing YAML
YAML can be used to store an object tree in a string. The API call is YAML.dump(object, io = nil, options = {}). The ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access