From: Brian Lonsdorf Date: 2008-11-28T02:33:15+09:00 Subject: Re: Design suggestion for translations/mappings from xml > class Test > include XMLMap > map :this, "/root/this/tag" > map :that, "/root/that/@attr" > end > > test = Test.new.from_xml > "this_value" > test.to_xml > > You could also implement a version of the map method that receives a > hash with all the mappings or whatever. > > Hope this helps, > > Jesus. Thanks so much for your response! The map method was the perfect solution to my problem. Declarative, organized, and maintainable. Previously, I kept trying to define them all in one spot - I just needed to think about it differently. One enhancement that made me smile was a call to attr_accessor in the map method :) -- Posted via http://www.ruby-forum.com/.