How to move attributes in Ruby hash "up" one level
Try this:
x = x.merge(x.delete(:data))
I'd go after it this way:
x = {:name => "John", :data => {:physical => {:age => 25, :weight => 150}}}
x[:physical] = x.delete(:data)[:physical]
pp x #=> {:name=>"John", :physical=>{:age=>25, :weight=>150}}