This bit is tricky because you have your num_pets in an array which means you have to use Ruby Enumerable class to loop over each element in the array. Again the first thing that we need to do it: 
i) Get the animal object out of the clients num_pets array; 
ii) Permanently delete this animal from the clients num_pets array; 
ii) Add this animal back to the shelter; 

Have a look at the following code which will implement the three points above; 

  selected_animal = shelter.clients[name].num_pets.select{|animal| animal.name == animals_adoption}
  shelter.clients[name].num_pets.reject!{|animal| animal.name == animals_adoption}
  adoption = shelter.clients[name].num_pets.delete(animals_adoption.to_s)
  
  shelter.animals[animals_adoption] << selected_animal