Class: Hash

Inherits:
Object show all
Defined in:
lib/to_xml.rb

Instance Method Summary collapse

Instance Method Details

#to_xml(name = nil) ⇒ Object



31
32
33
34
# File 'lib/to_xml.rb', line 31

def to_xml( name = nil )
  data = to_a.map{|k,v|v.to_xml(k)}.join
  name ? "<#{name}>#{data}</#{name}>" : data
end