Logo

Programming-Idioms

This language bar is your friend. Select your favorite languages!

Idiom #371 Load YAML file into object

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.

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

New implementation...
< >
programming-idioms.org