This is an excellent post.
Yonatan Laurence

Hey there! Thanks for your response!

invert is a method from Hash. It turns the keys into values and vice versa. Check out

In this specific case:

# => {"city"=>0, "mountain"=>1, "eletric"=>2}
# => {0=>"city", 1=>"mountain", 2=>"eletric"}
Like what you read? Give Jaimerson Araújo a round of applause.

From a quick cheer to a standing ovation, clap to show how much you enjoyed this story.