lib/xml/mapping_extensions.rb
# Writes this mapped object as a pretty-printed XML string.
#
# @param options [Hash] the options to be passed to
#   [XML::Mapping#save_to_xml](http://multi-io.github.io/xml-mapping/XML/Mapping.html#method-i-save_to_xml)
# @return [String] the XML form of the object, as a compact, pretty-printed string.
Writes this mapped object as a pretty-printed XML string.
Writes this mapped object as a pretty - printed XML string .
def write_xml(options = { mapping: :_default })
      xml = save_to_xml(options)
      formatter = REXML::Formatters::Pretty.new
      formatter.compact = true
      io = ::StringIO.new
      formatter.write(xml, io)
      io.string
    end
def write_xml ( options = { mapping : :_default } ) xml = save_to_xml ( options ) formatter = REXML :: Formatters :: Pretty . new formatter . compact = true io = :: StringIO . new formatter . write ( xml , io ) io . string end
Writes this mapped object as a pretty-printed XML string.
Writes this mapped object as a pretty - printed XML string .
the XML form of the object, as a compact, pretty-printed string.
the XML form of the object as a compact pretty - printed string .
String
options
the options to be passed to [XML::Mapping#save_to_xml]
the options to be passed to [ XML :: Mapping#save_to_xml ]