Method: DDEX.write

Defined in:
lib/ddex.rb

.write(xml, options = nil) ⇒ Object

Turn a DDEX object into an XML string. You can also turn the object into a Hash via #to_hash.

Parameters

xml (DDEX::Element subclass)

The object to create XML from

options (Hash)

Options to control writing

Options

:schema

Schema URI to use in the XSI schemaLocation attribute, defaults to DDEX::NAME.config["VER"][:schema] where NAME is the spec name and VER is the version. This is only used if xml is a the root node of a spec.

Returns

String

The XML

Errors

ArgumentError

options is not a Hash or is not nil, or xml is not a subclass of DDEX::Element



77
78
79
# File 'lib/ddex.rb', line 77

def self.write(xml, options = nil)
  DDEX::ERN.write(xml, options)
end