Class: Hash2xml::Hash

Inherits:
Object
  • Object
show all
Defined in:
lib/hash2xml.rb

Instance Method Summary collapse

Instance Method Details

#to_xmlObject



5
6
7
8
9
10
# File 'lib/hash2xml.rb', line 5

def to_xml
  map do |k, v|
    text = Hash === v ? v.to_xml : v
    "<%s>%s</%s>" % [k, text, k]
  end.join
end