Sha256: d1d18eedcf2a19dbe5e0abc0648201b94e99b27cce5fce54b105ded962b5fe45
Contents?: true
Size: 595 Bytes
Versions: 3
Compression:
Stored size: 595 Bytes
Contents
module DataMapper module Serialize module XMLSerializers module REXML def self.new_document ::REXML::Document.new end def self.root_node(document, name, attrs = {}) add_node(document.root || document, name, nil, attrs) end def self.add_node(parent, name, value, attrs = {}) node = parent.add_element(name) attrs.each {|attr_name, attr_val| node.attributes[attr_name] = attr_val} node << ::REXML::Text.new(value.to_s) unless value.nil? node end end end end end
Version data entries
3 entries across 3 versions & 2 rubygems