hash = {:a => {:b => [{:c => old_val}]}}
keys = [:a, :b, 0, :c]
new_val = 10
a = {:a => {:b => [{:c => 1}]}}
b = [:a, :b, 0, :c]
d = b.pop
b.inject(a) {|s,k| s[k]}[d] = 20
temp = hash
keys[0..-2].each do |k|
temp = temp.send(:'[]', k)
end
temp.send(:'[]=', keys.last, 10)