title: Converting Ruby array into a hash
body: <p>I am attempting to write a method named <code>my_transform</code> that takes an array as follows:</p>
  
  <pre><code>items = ["Aqua", "Blue", "Green", "Red", "Yellow"]
  </code></pre>
  
  <p>and displays the items' indexes as follows:</p>
  
  <pre><code>item_to_position = {"Aqua"=&gt;0, "Blue"=&gt;1, "Green"=&gt;2, "Red"=&gt;3, "Yellow"=&gt;4}
  </code></pre>
  
  <p>I should be able to execute:</p>
  
  <pre><code>my_transform(items) == item_to_position
  </code></pre>
  
  <p>and receive <code>true</code>.</p>
  
  <p>I have contemplated using <code>each_with_index</code>. Should I begin by saying:</p>
  
  <pre><code>items = ["Aqua", "Blue", "Green", "Red", "Yellow"]
  
  hash = Hash[*array]
  
  def my_transform
  </code></pre>
  
  <p>I have to convert the string to a hash. Any help is appreciated.</p>