YAML::load Method
load
Loads a single document from a stream

YAML::load(
  (String or IO) io
)

Parameters
io
The string or IO object to read from.
Return Values
A Ruby object

Details

The YAML::load method is for quick access to files containing a single YAML document. The document is parsed and the object it contains is returned. For example, to load the README that comes with YAML.rb:

readme = YAML::load( File.open( 'README' ) )
Ex. 37: YAML::load Example

Since this method only parses a single document, the IO object is closed when the method exits.