While I have your attention
I built a Ruby module for a class recently that’s designed to allow for flexible de/serialization of XML documents into and out of classes. The syntax looks something like this:
For convenience, and because I am both peachy keen and silky smooth:
The syntax is a little bit odd because of the constraints placed on us for this particular assignment (some very strange, arbitrary, not-really-XML grammar definitions) which is why the children in the example above are defined in an ordered list rather than a hash or something. But that’s easily cleaned up.
I’m thinking of releasing it as a gem, which is not something to which I’m accustomed. Would this be useful to anyone? It’d be cool to be able to define the deserialization grammar and the actions on a class simultaneously–say, for an RssFeed class, with RssItem children. I mean, not that there isn’t already an RSS gem. Because there is. But the idea of it makes me giddy, very much like a schoolchild of either gender.