Class | YAML::Stream |
In: |
lib/yaml/stream.rb
|
Parent: | Object |
documents | [RW] | |
options | [RW] |
# File lib/yaml/stream.rb, line 10 10: def initialize( opts = {} ) 11: @options = opts 12: @documents = [] 13: end
# File lib/yaml/stream.rb, line 23 23: def edit( doc_num, doc ) 24: @documents[ doc_num ] = doc 25: end
# File lib/yaml/stream.rb, line 27 27: def emit( io = nil ) 28: # opts = @options.dup 29: # opts[:UseHeader] = true if @documents.length > 1 30: out = YAML.emitter 31: out.reset( io || io2 = StringIO.new ) 32: @documents.each { |v| 33: v.to_yaml( out ) 34: } 35: io || ( io2.rewind; io2.read ) 36: end