This question is the inverse of this question.
Given a hash that has an array for each key like
{ [:a, :b, :c] => 1, [:a, :b, :d] => 2,
Using DeepEnumerable:
require DeepEnumerable h = {[:a, :b, :c]=>1, [:a, :b, :d]=>2, [:a, :e]=>3, [:f]=>4} h.inject({}){|hash, kv| hash.deep_set(*kv)}