YAML::Stream – for emitting many documents
# File syck/lib/syck/stream.rb, line 15
def []( i )
@documents[ i ]
end
# File syck/lib/syck/stream.rb, line 19
def add( doc )
@documents << doc
end
# File syck/lib/syck/stream.rb, line 23
def edit( doc_num, doc )
warn "#{caller[0]}: edit is deprecated" if $VERBOSE
@documents[ doc_num ] = doc
end
# File syck/lib/syck/stream.rb, line 28
def emit( io = nil )
# opts = @options.dup
# opts[:UseHeader] = true if @documents.length > 1
out = Syck.emitter
out.reset( io || io2 = StringIO.new )
@documents.each { |v|
v.to_yaml( out )
}
io || ( io2.rewind; io2.read )
end