Z
zuzu
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 …
| <person>
| <name>jim</name>
| <phone local="yes">555-1234</phone>
| <address>Cincinnati</address>
| </person>
"
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 …
| <person>
| <name>jim</name>
| <phone local="yes">555-1234</phone>
| <address>Cincinnati</address>
| </person>
"