How to Convert a Ruby Array into Hash Keys

A current project requires converting an array into a hash. The requirement is simple. The values of the array need to become the keys of the hash. Each key pointing to an empty value until more work is done later in the process. The approach I'm using is to the Ruby Array object's `.collect` method like so:

It works great. Here's a demo script showing it in action:

The output of which confirms the hash is created exactly as I need:

Of course, the processing block can assign values as well. For example, changing the above example to use:

would produce the hash with: