lib/berkeley_library/tind/marc/xml_writer.rb
# Opens a new {XMLWriter} with the specified output destination and
# Nokogiri options, writes the XML prolog and opening `<collection>`
# tag, yields the writer to write one or more MARC records, and closes
# the writer.
#
# ```ruby
# XMLWriter.open('marc.xml') do |w|
#   marc_records.each { |r| w.write(r) }
# end
# ```
#
# Note that unlike initializing a writer with {#new} and closing it
# immediately, this will write an XML document with an empty
# `<collection></collection>` tag even if no records are written.
#
# @yieldparam writer [XMLWriter] the writer
# @see #new
# @see #close
Opens a new {XMLWriter} with the specified output destination and
Nokogiri options, writes the XML prolog and opening ``
tag, yields the writer to write one or more MARC records, and closes
the writer.



Note that unlike initializing a writer with {#new} and closing it
immediately, this will write an XML document with an empty
`` tag even if no records are written.
Opens a new { XMLWriter } with the specified output destination and Nokogiri options writes the XML prolog and opening ` ` tag yields the writer to write one or more MARC records and closes the writer . Note that unlike initializing a writer with { #new } and closing it immediately this will write an XML document with an empty ` ` tag even if no records are written .
def open(out, **nokogiri_options)
            writer = new(out, **nokogiri_options)
            writer.send(:ensure_open!)
            yield writer if block_given?
            writer.close
          end
def open ( out , ** nokogiri_options ) writer = new ( out , ** nokogiri_options ) writer . send ( :ensure_open! ) yield writer if block_given? writer . close end
Opens a new {XMLWriter} with the specified output destination and
Nokogiri options, writes the XML prolog and opening `<collection>`
tag, yields the writer to write one or more MARC records, and closes
the writer.
Opens a new { XMLWriter } with the specified output destination and Nokogiri options writes the XML prolog and opening ` <collection > ` tag yields the writer to write one or more MARC records and closes the writer .
out
<not_specific>
nokogiri_options
<not_specific>
writer
<not_specific>
None
see
None
see
None