lib/imw/formats/yaml.rb in imw-0.2.7 vs lib/imw/formats/yaml.rb in imw-0.2.8
- old
+ new
@@ -25,18 +25,16 @@
# Iterate over the elements in the YAML.
def each &block
load(&block)
end
- # Dump the +data+ into this resource. It must be opened for
+ # Emit the +data+ into this resource. It must be opened for
# writing.
#
- # @param [Hash, String, Array, Fixnum] data the Ruby object to dump
- # @option options [true, false] :persist (false) Don't close the IO object after writing
- def dump data, options={}
+ # @param [Hash, String, Array, Fixnum] data the Ruby object to emit
+ def emit data, options={}
require 'yaml'
write(data.to_yaml)
- io.close unless options[:persist]
self
end
end
end
end