Hal Fulton wrote:
The problem is literals or constants. Nothing I do will ensure that
the hash { x=>a, y=>b, z=>c } will be iterated over in that
original specified order.
[ ['x','a'], ['y','b'], ['z','c'] ].each{|x| p x}
["x", "a"]
["y", "b"]
["z", "c"]
[ ['x','a'], ['y','b'], ['z','c'] ].assoc('z')
=> ["z", "c"]