lib/imw/formats/json.rb in imw-0.2.7 vs lib/imw/formats/json.rb in imw-0.2.8

- old
+ new

@@ -25,18 +25,16 @@ # Iterate over the elements in the JSON. 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 'json' write(data.to_json) - io.close unless options[:persist] self end end end end