Converting Ruby Array into a Hash *Must Use a Function* : I am attempting to write a function (method) in Ruby which takes and array as follows:

items = ["Aqua", "Blue", "Green", "Red", "Yellow"]

I need to write a function that will display the items' indexes as follows:
item_to_position={"Aqua"=>0, "Blue"=>1, "Green"=>2, "Red"=>3, "Yellow"=>4}

I have already contemplated using "each_with_index" and I've spent hours researching how to do this in a function.

my_transform is the name of the function. I should be able to type in
my_transform(items)=item_to_position and receive TRUE when executed.

Should I begin by saying:
items = ["Aqua", "Blue", "Green", "Red", "Yellow"]

hash = Hash[*array]

def my_transform

Any help is appreciated. I have to convert the string to a hash. 