This might be a silly question, but I'm struggling with outputting the positions of an array of hashes I have.

If I have an array of hashes, we'll call `some_array`, that looks like this:

```
some_array =
 [{:id=>7, :people=>["Bob B", "Jimmy J"], :product=>"product1"},
 {:id=>2, :people=>["Sally S"], :product=>"product1"},
 {:id=>5, :people=>["Hank H", "Stan C"], :product=>"product2"},
 {:id=>3, :people=>["Sue T"], :product=>"product2"},
 {:id=>4, :people=>["Anne W"], :product=>"product3"}]

```

I then iterate though `some_array` like so:

```
some_array.select{|p| p[:product] == "product2"]}.each do |product|
     product[:people].join("<br>")         
     product[:product]

```

Which outputs like:

```
Hank K      product 2
Stan C

Sue T       product 2   

```

How would I go about outputting the index/position of each hash in the array?

Would I be able to do something along the lines of: 

```
some_array.select{|p| p[:product] == "product2"]}.each do |product|
     product.index
     product[:people].join("<br>")         
     product[:product]

```

And get:

```
2   Hank K      product2
    Stan C

3   Sue T       product2

```

Thank you!