Flowdock
method

load_stream

Importance_1
v1_9_3_392 - Show latest stable - 0 notes - Class: Psych
load_stream(yaml, filename = nil) public

Load multiple documents given in yaml. Returns the parsed documents as a list. If a block is given, each document will be converted to ruby and passed to the block during parsing

Example:

Psych.load_stream("--- foo\n...\n--- bar\n...") # => ['foo', 'bar']

list = []
Psych.load_stream("--- foo\n...\n--- bar\n...") do |ruby|
  list << ruby
end
list # => ['foo', 'bar']
Show source
Register or log in to add new notes.