looping over array Ruby cucumber : I am trying to write a test in Cucumber using Ruby.  I have an array:

    contacts = Array.new(arg1, arg2, arg3, arg4)

And I want to create a loop that will take that array and fill in a field with that array. Kind of like:

    while contacts.index[0] < contacts.index[3]
      fill_in('field', with: contacts)
       ...
         contacts +=1
    end


I can't seem to get this to work, it tells me I've got the wrong number of arguments 

    ArgumentError: wrong number of arguments (4 for 0..2)


Is there something blindingly obvious I'm missing?

Thanks