Ruby’s implementation of to_h has finally been added to the core Array class. This method converts our multidimensional array into a key-value store. >> [[1,2]].to_h => {1=>2}   >> [[1,2], [:party, :fun_times]].to_h => {1=>2, :party=>:fun_times}   >> [1,2].to_h TypeError: wrong element type Fixnum at 0 (expected array) :)

Ruby’s hash merge allows a third parameter when passed a block. >> vessel_params = { "year" => 1120, "boat_id" => 234543 } >> user_params = { "year" => 1998, "user_id" => 330 } >> vessel_params.merge!(user_params) { |key, v1, v2| v1 } #=> {"year"=>1120, "boat_id"=>234543, "user_id"=>330}   >>vessel_params.merge!(user_params) { |key, v1, v2| v2 } #=> {"year"=>1998, "boat_id"=>234543, "user_id"=>330} Here is the documentation: “{|key, oldval, newval| block} → hsh” :)