Class: Hash2xml::Hash
- Inherits:
-
Object
- Object
- Hash2xml::Hash
- Defined in:
- lib/hash2xml.rb
Instance Method Summary collapse
Instance Method Details
#to_xml ⇒ Object
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 |