method

load_documents

v1_8_7_330 - Show latest stable - Class: YAML
load_documents( io, &doc_proc )
public

Calls block with each consecutive document in the YAML stream contained in io.

File.open( 'many-docs.yaml' ) do |yf|
  YAML.load_documents( yf ) do |ydoc|
    ## ydoc contains the single object
    ## from the YAML document
  end
end