class Hash

Public Class Methods

from_xml(s, opts={}) click to toggle source
# File lib/rrrmatey/type_coercion.rb, line 39
def self.from_xml(s, opts={})
    XmlSimple.xml_in(s, :force_array => false)
end

Public Instance Methods

to_xml(opts = {}) click to toggle source
# File lib/rrrmatey/type_coercion.rb, line 31
def to_xml(opts = {})
    root_name = opts[:root] || 'root'
    self.keys.each { |k| self[k] = 'null' if self[k].nil? }
    XmlSimple.xml_out(self, :root_name => root_name)
end