Module: XML::Mapping
- Defined in:
- lib/xml/mapping_extensions.rb
Defined Under Namespace
Modules: ClassMethods
Instance Method Summary collapse
-
#write_xml(options = { mapping: :_default }) ⇒ String
Writes this mapped object as an XML string.
Instance Method Details
#write_xml(options = { mapping: :_default }) ⇒ String
Writes this mapped object as an XML string.
18 19 20 21 22 23 24 25 |
# File 'lib/xml/mapping_extensions.rb', line 18 def write_xml( = { mapping: :_default }) xml = save_to_xml() formatter = REXML::Formatters::Pretty.new formatter.compact = true io = ::StringIO.new formatter.write(xml, io) io.string end |