Ruby: Hash rearranging with pigeons