Module: XmlInKdl::Encoder
- Defined in:
- lib/xml_in_kdl/encoder.rb
Class Method Summary collapse
Class Method Details
.encode(xml) ⇒ Object
4 5 6 7 8 |
# File 'lib/xml_in_kdl/encoder.rb', line 4 def encode(xml) encoding_node = encode_encoding(xml.encoding) children = xml.children.map { |c| encode_node(c) } ::KDL::Document.new([encoding_node, *children].compact) end |