> So consider Enumerable#associate which builds a mapping by *associating*
keys with values

I like Enumerable#associate. It would cover many of the cases where
each_with_object({}) is currently used.

However, I think '[[1,2],[3,4]].to_h' would be better for when an Array is
already in the 'associated' form. See #7292 for that discussion:
https://bugs.ruby-lang.org/issues/7292<https://bugs.ruby-lang.org/issues/7292#change-32586>
.

If the #to_h method was also available, then #associate could require a
block, and it would be the inverse of Active Support's 'index_by' method
(it would yields values instead of keys):
http://api.rubyonrails.org/classes/Enumerable.html#method-i-index_by

I'm still wondering if there should be a method that allows you to return
both key and value, but  'map {|e| [e * 2, e ** 2] }.to_h' would probably
be sufficient.

(sorry for bringing #7292 into the discussion, but I feel like it's a
related issue.)