Logo

Programming-Idioms

Read from the file data.yaml and write its content into the object x.
Assume the YAML data is suitable for the type of x.
New implementation

Be concise.

Be useful.

All contributions dictatorially edited by webmasters to match personal tastes.

Please do not paste any copyright violating material.

Please try to avoid dependencies to third-party libraries and frameworks.

Other implementations
require 'yaml'
x = YAML.load(File.read('data.yaml'))