From: Brian Lonsdorf Date: 2008-12-02T10:14:23+09:00 Subject: Re: Design suggestion for translations/mappings from xml > I haven't tested very thoroughly, so there might be a bug or two in > there. Probably you will want to reimplement the to_xml method to use > a proper XML generator. > Any comment about the code or approach appreciated, for sure there's > room for improvement :-) > > Regards, > > Jesus. Wow, that's pretty kickass. # I love this. xml = Hash.new {|h,k| h[k] = Hash.new(&h.default_proc)} tags[1..-2].inject(xml) {|h, tag| h[tag]} I actually did some of the same stuff last week, but a lot less generic and sophisticated. I hadn't realized the potential of having a cool little library for this stuff. You should release it - I would have used this for sure if I'd found it on github. -- Posted via http://www.ruby-forum.com/.