load_stream

load_stream(yaml, filename = nil)
Class Public methods

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']
doc_ruby_on_rails
2015-04-29 19:05:07
Comments
Leave a Comment

Please login to continue.