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]whereNAMEis the spec name andVERis the version. This is only used ifxmlis a the root node of a spec.
Returns
- String
-
The XML
Errors
- ArgumentError
-
optionsis not aHashor is notnil, orxmlis not a subclass ofDDEX::Element
77 78 79 |
# File 'lib/ddex.rb', line 77 def self.write(xml, = nil) DDEX::ERN.write(xml, ) end |