I have an array @contacts of hashes, each of which has the following keys:
:full_name
:city
:state
:email
How would I iterate through the array to return the :city values uniquely? Below is my best attempt
@contacts.uniq {|hash| hash[:city]}
I have an array @contacts of hashes, each of which has the following keys:
:full_name
:city
:state
:email
How would I iterate through the array to return the :city values uniquely? Below is my best attempt
@contacts.uniq {|hash| hash[:city]}