S
Stefan Rusterholz
Florian said:hash.update(hash) { |key, o_val, n_val| Hash['name' => o_val] }
Hash[foo => bar] is a needless method call. foo => bar is already a hash
literal, Hash::[] creates a new hash from that hash (suprised me a bit
tbh, as I don't really see a reason for it to do that), though. But
since that's useless work and method calls weigh heavy in ruby, I'd not
do that.
You can try it if you want:
x = {:a => :b}
Hash[x].equal?(x) #Â => false
Regards
Stefan