On 1/8/06, Hal Fulton <hal9000 / hypermetrics.com> wrote:

> Only a class that specifically supported that kind of behavior
> would allow such a thing. See the 'ostruct' (OpenStruct)
> library. Its author created it mostly as a toy, I think, but
> it has been used in many situations. (I would not personally
> suggest that *all* objects should behave that way.)

Not all objects, but if your goal is to hold a ton of 'never before
seen' attributes, it certainly does help.

I had this exact issue with Ruport, and created a sort of abstract
node for a tree structure, using OStruct.  See it here:

http://www.oreillynet.com/ruby/blog/2006/01/so_wrong_its_almost_right.html

Probably a bad idea for most things, but it cut me about a 100 lines
in Ruport :)