> Written out longhand as above:
Perhaps I should have done this more clearly:
tmp = {}
[[:diameter, 45], [:id, 2]].each do |element|
result = tmp
tmp = (
result[element.first] = element.last
result
)
end
hash = tmp
The part in parentheses is the block, and you can see that the overall
value from executing the block is assigned to 'tmp' to be used in the
next iteration.
--
Posted via http://www.ruby-forum.com/.