[ANN] SuperHash

OK, it’s a corny name, but I’m open to suggestions…

A SuperHash is a hash-like object which can inherit key-value pairs from
parent hashes. It can also have its own key-value pairs, which override
inherited pairs. From the documentation:

The Ruby inheritance system is a powerful way to organize methods and
constants in a hierarchy of classes and modules. However, it does not
provide an easy way to organize inherited attribute values in such a
hierarchy. A class variable is stored in the base class in which it
was defined; its value can be changed by a subclass, but that change
propagates to all subclasses of the base class. A class instance
variable can take on a different value in each subclass, but there is
no inheritance mechanism; its value is privately accessible by its
owner, and does not propagate to subclasses.

SuperHash solves this class attribute problem and in addition is a
general mechanism for defining attribute inheritance structures among
objects of any type, not just classes. An example of the former is
StateObject, in examples/state-object.rb. An example of the latter is
AttributedNode defined in examples/attributed-node.rb…

It’s on RAA and at http://redshift.sourceforge.net/superhash, and comes
with tests and documentation.