[]( i )
click to toggle source
def []( i )
@documents[ i ]
end
add( doc )
click to toggle source
def add( doc )
@documents << doc
end
edit( doc_num, doc )
click to toggle source
def edit( doc_num, doc )
@documents[ doc_num ] = doc
end
emit( io = nil )
click to toggle source
def emit( io = nil )
out = YAML.emitter
out.reset( io || io2 = StringIO.new )
@documents.each { |v|
v.to_yaml( out )
}
io || ( io2.rewind; io2.read )
end