[Ruby] [ruby] Double hash

less than 1 minute read

Contents

Code in Ruby so that only the names of all users are output from the double hash!
image.png
However, the output result shall be as follows.
image.png

Implementation

Since it is an array, it is possible to pull the value with each! Let’s write the code!
image.png
What you are doing here is to search the contents of user_data with each and write the hash key [: user] [: profile] [: name] to search one by one. I will!

Let’s see the output result!
image.png
I succeeded in pulling only all the names successfully!

This reference article

https://note.com/sairyo/n/n937886e50966

Tags:

Updated: