From: zuzu Date: 2004-08-28T14:07:43+09:00 Subject: method_missing and builder objects jim weirich's got a hot example of using 'method_missing' to build XML trees from defining methods in ruby objects. (idea originally from groovy, the rubyish java bastard language.) http://www.onestepback.org/index.cgi/Tech/Ruby/BuilderObjects.rdoc "Ack, it's easy to see it in action than to describe it. For example, the following code … | builder = Builder::XmlMarkup.new("", 2) | puts builder.person { | name("jim") | phone("555-1234", "local"=>"yes") | address("Cincinnati") | } will print … | | jim | 555-1234 |
Cincinnati
|
"